Select multiple entities to pull apart

Select multiple entities to pull apart

Anonymous
Not applicable
483 Views
3 Replies
Message 1 of 4

Select multiple entities to pull apart

Anonymous
Not applicable

Hello

 

I am trying to make a program in which the user can select all erf numbers in a drawing, and thereby a table can be made (in the drawing and at a position chosen by the user) of giving the erf number and its insertion point as its coordinate. 

 

I can easily do this with one entity at a time (user clicking on erf numbers individually) - see attached. I do not know how to select multiple entities (in this case the erf numbers) and pull them apart (assocc and alike)...

 

What would be the best way for me to do this?

 

Cheers

 

Derryck

0 Likes
484 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant

Just a little help 🙂

 

(setq ss (ssget '(0 . "*TEXT")))  ; select just text

(repeat (setq n (sslength ss))
  (setq en (ssname ss (setq n (1- n))))   ; en is entity name like your e1

  ;... here you do your stuff now inside (while)

  )

BUT - you would probably need some kind of sorting function, don't you?

0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi. No I won't need any sorting function.

 

But, I do get the error:

 

"error: bad point argument"

 

Which breaks on:

 

(ssget '(0 . "*TEXT"))

 

?

0 Likes
Message 4 of 4

ВeekeeCZ
Consultant
Consultant

Sorry, one more parenthesis
(ssget '((0 . "*TEXT")))

 

Read here for more about ssget filtres.

Here on the same web (and thank to Lee Mac) is some more tutorials - inc. "Selection Set Processing"

0 Likes