Hello, I would like some help with selecting block by name, I have a working code, but want to replace the entsel with something that automatically selects an object by name. Any help would be appreciated, thank you! My code is attached.
|
Hello, I would like some help with selecting block by name, I have a working code, but want to replace the entsel with something that automatically selects an object by name. Any help would be appreciated, thank you! My code is attached.
Please upload your sample.dwg , with some dyn blocks .
I'm really busy at the moment, so I don't have time to help you edit your lisp. However, I can point you in the right direction. Whenever you edit a dyn block by changing one of it's dynamic properties, stretch, etc., AutoCAD creates an Anonymous block based on the original block definition. An anonymous block has a block name that starts with "U**" and doesn't show up in block lists, like the CLASSICINSERT or RENAME dialogs. But the ActiveX object has an EffectiveName property that you can use in a selectionset filter. With that knowledge, you can search this forum for some code samples.
Like Ed you can ssget blocks then as a second step look for "effective name" by looping through the blocks selected and say make a second selection set.
Note block name is "*Uxxx"Code:(setq ss (ssget '((0 . "INSERT")(cons 2 "**U*"))))