find a dynamic bloc

find a dynamic bloc

tarin_lc
Participant Participant
470 Views
3 Replies
Message 1 of 4

find a dynamic bloc

tarin_lc
Participant
Participant

Hello,
Here is a LISP code to find the coordinates of a block. It works perfectly except in the case of a dynamic block, which doesn't find it. What could I change to find the coordinates or other properties of a dynamic block?

 

thanks a lot !

0 Likes
Accepted solutions (2)
471 Views
3 Replies
Replies (3)
Message 2 of 4

Sea-Haven
Mentor
Mentor

This will find dynamic blocks in a layout

 

(setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 "*U*")(cons 410 (getvar 'ctab)))))

You can then get properties like layer and Insertionpoint. You can go deeper and get the dynamic properties. I would also look at Effectivename which is original block name.

 

0 Likes
Message 3 of 4

komondormrex
Mentor
Mentor
Accepted solution

hi,

change in the code 

this

(if (= (vla-get-Name item) "1")

for that

(if (= (vla-get-effectiveName item) "1")

Message 4 of 4

tarin_lc
Participant
Participant
Accepted solution

Perfect!

Thanks for all guys 🙂

0 Likes