TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: mailmaverick on December 26, 2016, 12:36:31 AM

Title: ssget force single entity selection only
Post by: mailmaverick on December 26, 2016, 12:36:31 AM
How to force ssget for single entity selection only.
I dont want to use (entget) because filters cannot be applied on it.
Thanks.
Title: Re: ssget force single entity selection only
Post by: didier on December 26, 2016, 02:22:44 AM
Coucou

Hello !

try this :
Code: [Select]
(setq jeusel (ssget
             "_+.:E:S"
             (list '(0 . "LWPOLYLINE"))
             )
    )

friendly, amicalement


Title: Re: ssget force single entity selection only
Post by: Grrr1337 on December 26, 2016, 05:15:34 AM
Or:

Code: [Select]
(setq s (ssget "_+.:S"))
I've forgot whats the difference with/without using aperture (:E), but seems to work too.

LM's ssget reference (http://www.lee-mac.com/ssget.html).

Title: Re: ssget force single entity selection only
Post by: HasanCAD on December 26, 2016, 07:58:53 AM
http://lee-mac.com/ssget.html
Title: Re: ssget force single entity selection only
Post by: Marc'Antonio Alessi on December 26, 2016, 12:55:36 PM
https://www.theswamp.org/index.php?topic=51372.msg564957#msg564957
Title: Re: ssget force single entity selection only
Post by: David Bethel on December 28, 2016, 03:48:08 PM
Code - Auto/Visual Lisp: [Select]
  1. (setq en nil)
  2. (while (not en)
  3.   (and (setq ss (ssget))
  4.        (= (sslength ss) 1)
  5.        (setq en (ssname ss 0))))

You could add filters as needed

-David
Title: Re: ssget force single entity selection only
Post by: mailmaverick on December 29, 2016, 01:13:47 AM
Thanks all.