View Full Version : Selecting Dynamic Block By Name in AutoCAD
blake803622
2023-02-06, 04:49 PM
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.
devitg.89838
2023-02-10, 02:37 PM
Please upload your sample.dwg , with some dyn blocks .
Ed Jobe
2023-02-10, 03:32 PM
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 (https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-A87607A4-D7F9-40B3-94B5-B9D88011DEB5) property that you can use in a selectionset filter. With that knowledge, you can search this forum for some code samples.
BIG-AL
2023-02-12, 09:02 PM
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.
(setq ss (ssget '((0 . "INSERT")(cons 2 "**U*"))))
Note block name is "*Uxxx"
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.