Author Topic: SSGET filter list with DYNAMIC BLOCKS  (Read 1705 times)

0 Members and 1 Guest are viewing this topic.

domenicomaria

  • Swamp Rat
  • Posts: 723
SSGET filter list with DYNAMIC BLOCKS
« 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?

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: SSGET filter list with DYNAMIC BLOCKS
« Reply #1 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 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 page.

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: SSGET filter list with DYNAMIC BLOCKS
« Reply #2 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