Author Topic: ssget force selection of 1 entity only  (Read 2661 times)

0 Members and 1 Guest are viewing this topic.

mailmaverick

  • Bull Frog
  • Posts: 493
ssget force selection of 1 entity only
« on: April 19, 2015, 04:50:47 PM »
How to force ssget to select 1 entity only (The first one user picks which matches filter list criteria) ?


Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: ssget force selection of 1 entity only
« Reply #1 on: April 19, 2015, 04:53:44 PM »
You can use the "_:S" mode string - see my reference here for more information.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: ssget force selection of 1 entity only
« Reply #2 on: April 19, 2015, 08:12:39 PM »
How to force ssget to select 1 entity only (The first one user picks which matches filter list criteria) ?
or more conventionally, have a look at ssget in your help file that comes with AutoCAD
something like : http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-0F37CC5E-1559-4011-B8CF-A3BA0973B2C3
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: ssget force selection of 1 entity only
« Reply #3 on: April 20, 2015, 03:48:48 AM »
Note that 'single selection' does not mean 'single entity'. To achieve the latter you have to add '+.' to disallow selection windows.
Code: [Select]
(ssget "+.:S")

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: ssget force selection of 1 entity only
« Reply #4 on: April 20, 2015, 04:35:54 AM »
How to force ssget to select 1 entity only (The first one user picks which matches filter list criteria) ?
or more conventionally, have a look at ssget in your help file that comes with AutoCAD
something like : http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-0F37CC5E-1559-4011-B8CF-A3BA0973B2C3

It's a shame the help file doesn't include all of the available mode strings...

mailmaverick

  • Bull Frog
  • Posts: 493
Re: ssget force selection of 1 entity only
« Reply #5 on: April 21, 2015, 03:15:50 AM »
Thanks a lot everyone.

Single selection : (ssget ":S")

Single entity : (ssget "+.:S")


David Bethel

  • Swamp Rat
  • Posts: 656
Re: ssget force selection of 1 entity only
« Reply #6 on: April 22, 2015, 07:45:56 AM »
The verbose version :

Code: [Select]
(while (or (not ss)
           (/= (sslength ss) 1))
       (setq ss (ssget)))
R12 Dos - A2K