PDA

View Full Version : prompting with ssget


Rryst
2009-07-07, 06:11 AM
This is exceptionally minor but it's one of those 'surely this can be done and why can't I figure out how' moments.

Bascially I want to be able to customise the prompt when using ssget like you can with entsel, etc. ie. replace the standard "select objects:" with something else.

I've read a few tutorials and they say use;

(ssget "\nYour prompt")

but it doesn't work. You get "bad ssget mode string" - I suppose it's looking for "X" or "W", etc and getting something it doesn't understand which makes sense.

Anyway, if anyone could tell me what I'm missing that'd be great.

irneb
2009-07-07, 07:06 AM
Welcome to AUGI & congrats on your 1st post.

Unfortunately ssget does not have that functionality. It could be created though, but it would not be a trivial task as you need to create a ssget like function from scratch. Look e.g. at the SSX.LSP file in the Express Tools folder. Also look at the AI_UTILS.LSP file ... see the ai_select1 function.

Neither of these do exactly what you want, but they do give some ideas of how to try an implement it.

Rryst
2009-07-07, 07:18 AM
I'm not quite that nice a person. I'll just keep reminding people there's a command line they can look at. ;)

Thanks.

'gile'
2009-07-07, 12:33 PM
Hi,

Here's a little routine.
Notice that there won't be any other prompt message during the selection ("opposite corner", "objects found" and so on).

;; ssprompt (gile)
;; ssget with a prompt message
;;
;; Arguments
;; filter: a filter list as for ssget (or nil)
;; msg: the prompt message

(defun ssprompt (filter msg / ss)
(prompt msg)
(setvar "NOMUTT" 1)
(vl-catch-all-apply '(lambda () (setq ss (ssget filter))))
(setvar "NOMUTT" 0)
ss
)

Using :

(ssprompt '((0 . "CIRCLE")) "\nSelect circles: ")

(ssprompt nil "\nWould you mind select some objects, please: ")

irneb
2009-07-08, 05:55 AM
That works if you're only concerned with the command line. Unfortunately if you've got Dynamic Input (DYNMODE > 0) the prompt following the cursor still shows the "Select objects: "; "Specify opposite corner: "; etc.