Author Topic: Prompting a user for the name of a selection set  (Read 1946 times)

0 Members and 1 Guest are viewing this topic.

jtigrett

  • Guest
Prompting a user for the name of a selection set
« on: April 12, 2015, 07:43:13 PM »
Is there a way to prompt a user for the name (variable) of a selection set.

For instance I have a palette tool with the following macro that essentially does what I want but (correct me if I am wrong) I don't believe it is possible, using the macro method, to prompt a user with the question "Choose the selection set name".

Code: [Select]
^C^C(setq \ (ssget "X" '((0 . "lwpolyline"))));
So When the person using this tool selects the button they will need to understand that the macro is waiting for them to supply the variable before it completes the selection set.

Therefore I wanted to write a lisp routine that would prompt the user for the selection set variable/name and in doing so cut down on any confusion.

Any help would be appreciated.

Thanks

pBe

  • Bull Frog
  • Posts: 402
Re: Prompting a user for the name of a selection set
« Reply #1 on: April 13, 2015, 05:23:51 AM »
Code: [Select]
^C^C (and
      (setq vname (getstring "\nEnter Selection set name: "))
      (snvalid vname)
      (set  (read vname) (ssget "X" '((0 . "lwpolyline"))))      )

jtigrett

  • Guest
Re: Prompting a user for the name of a selection set
« Reply #2 on: April 13, 2015, 08:19:33 PM »
pBe,

Thanks so much for the response. Your code worked perfectly. I only hope that I am able, in time, to contribute in addition to receiving. Nevertheless, this is a fantastic forum and it is nice to know that such a place exists where so many generous and knowledgeable people are willing to give of their time.

pBe

  • Bull Frog
  • Posts: 402
Re: Prompting a user for the name of a selection set
« Reply #3 on: April 14, 2015, 05:15:29 AM »

I only hope that I am able, in time, to contribute in addition to receiving.


Just hang around this fantastic forum and in time you will  :)




CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Prompting a user for the name of a selection set
« Reply #4 on: April 14, 2015, 09:40:35 AM »
pBe,

 I only hope that I am able, in time, to contribute in addition to receiving. Nevertheless, this is a fantastic forum and it is nice to know that such a place exists where so many generous and knowledgeable people are willing to give of their time.

That is what makes this place so great. People who learn there skills here give back by sharing there knowledge.

Welcome to the Swamp.  8)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.