TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: domenicomaria on January 20, 2021, 05:40:44 AM

Title: SSGET filter list with DYNAMIC BLOCKS
Post by: domenicomaria on January 20, 2021, 05:40:44 AM
If I want to  filter in a selection set all the INSERT that are called "ARROW RIGHT",
I have to do this :
(setq ss (ssget (list (cons 0 "INSERT")(cons 2 "ARROW RIGHT"))))

but, if the block is  a DYNAMIC BLOCK, where the EFFECTIVE NAME is "ARROW RIGHT"
obviously the same code doesn't work !

So what is the way to achieve the same result ?

Do I have to "scan" the selection set to check the EFFECTIVE NAME of each insert found?

Isn't there another faster and smarter way?
Title: Re: SSGET filter list with DYNAMIC BLOCKS
Post by: Lee Mac on January 20, 2021, 08:25:25 AM
You can either iterate over the selection set and only operate on those references whose effective name (http://lee-mac.com/effectivename.html) matches your target block name, or alternatively, if you wish to filter for the appropriate block references at the point of selection, you can follow an approach similar to that described on my Get Anonymous References (http://lee-mac.com/getanonymousreferences.html) page.
Title: Re: SSGET filter list with DYNAMIC BLOCKS
Post by: domenicomaria on January 20, 2021, 08:34:09 AM
thanks a lot Lee Mac

your code is always the best and is always very interesting. . .
. . .
but I have to study it a little, because I want to understand it before using it
. . .

Thanks again
...
ciao