Author Topic: ssget force single entity selection only  (Read 1479 times)

0 Members and 1 Guest are viewing this topic.

mailmaverick

  • Bull Frog
  • Posts: 493
ssget force single entity selection only
« 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.

didier

  • Newt
  • Posts: 48
  • expatrié
Re: ssget force single entity selection only
« Reply #1 on: December 26, 2016, 02:22:44 AM »
Coucou

Hello !

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

friendly, amicalement


eternal beginner ...
my english is not fluent ...

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: ssget force single entity selection only
« Reply #2 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.

(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)
vevo.bg

HasanCAD

  • Swamp Rat
  • Posts: 1422
Re: ssget force single entity selection only
« Reply #3 on: December 26, 2016, 07:58:53 AM »


David Bethel

  • Swamp Rat
  • Posts: 656
Re: ssget force single entity selection only
« Reply #5 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
R12 Dos - A2K

mailmaverick

  • Bull Frog
  • Posts: 493
Re: ssget force single entity selection only
« Reply #6 on: December 29, 2016, 01:13:47 AM »
Thanks all.