Can you give instructions during user input with ssget?

Can you give instructions during user input with ssget?

Darrick.Earley
Explorer Explorer
2,485 Views
7 Replies
Message 1 of 8

Can you give instructions during user input with ssget?

Darrick.Earley
Explorer
Explorer

I am very new to creating AutoLISP routines and trying to figure them out. From what I've picked up and learned so far, I know I can give an instruction that shows up in the command bar when using the getpoint function when I write it like this:
(setq pt1 (getpoint "Select starting point:"))

With that "Select starting point:" displays in the command bar for the user.

 

However, I can't seem to do the same with ssget. If I try something similar (subbing getpoint for ssget in the example above):
(setq ss1 (ssget "Select the specific objects:"))

AutoCAD gives me "bad ssget mode string".

 

Is there a way to display instructions for a user when using ssget?

 

TIA for any help.

0 Likes
Accepted solutions (1)
2,486 Views
7 Replies
Replies (7)
Message 2 of 8

ВeekeeCZ
Consultant
Consultant

Not as simple as with (entsel) but possible. There is the nomutt system variable.

But it's kinda dangerous game - you really need to make sure that you set it back to zero - do you know how to use the *error* function? If not, better hands-off the nomutt. Once you keep it on, you won't see any prompts on the command-line. Lots of people better not using it at all.

 

(setvar 'nomutt 1)
(princ "\nSelect viewport: ")
(setq s (ssget "_+.:E:S" '((0 . "VIEWPORT"))))
(setvar 'nomutt 0)

 

Message 3 of 8

Darrick.Earley
Explorer
Explorer

Unfortunately, I do not know how to use the *error* function. I also still haven't learned some of the other functions mentioned in your answer (setvar and princ).

One thing I think I've learned from looking through other ssget posts in the forum is that the ":S" only gives the user a single click chance. Is that correct? If so, I don't think that would work as I would want to let the user select multiple objects and they would be scattered (so can't do a lasso selection).

0 Likes
Message 4 of 8

ВeekeeCZ
Consultant
Consultant

That was just an example. It works with simple (ssget) too. 

Better then use the common approach:

 

(princ "\nSelect something extraordinary, ")

(ssget)

0 Likes
Message 5 of 8

Kent1Cooper
Consultant
Consultant

I usually put in a (prompt) to the user just before the (ssget) function, with a phrase ending in a comma so that (ssget)'s own  Select objects:  prompt [that you have no control over] sort of follows naturally, though unavoidably on a new line:

 

(prompt "\nTo do whatever it is you intend to do with them,")

(ssget '((0 . ......

Kent Cooper, AIA
0 Likes
Message 6 of 8

Darrick.Earley
Explorer
Explorer

Thank you both @ВeekeeCZ and @Kent1Cooper . Both those options are getting really close to what I'm hoping for. With both of those, it shows the instruction text just above the command bar as if it's a previously/recently used command. If that's the best I can get with my limited LISP understanding then that's fine.

What I am really hoping for is something that would say "Select all perimeter tubes:" in the command bar during the selection step instead of "Select objects:".

0 Likes
Message 7 of 8

Kent1Cooper
Consultant
Consultant
Accepted solution

@Darrick.Earley wrote:

.... What I am really hoping for is something that would say "Select all perimeter tubes:" in the command bar during the selection step instead of "Select objects:".


Aren't we all...?  Unfortunately, (ssget) doesn't have the option to spell out the prompt, the way the various (get...) functions do.

Kent Cooper, AIA
0 Likes
Message 8 of 8

Darrick.Earley
Explorer
Explorer

Ok. Well thank you for letting me know about the (prompt) option.

0 Likes