Update Block attribute with Script

Update Block attribute with Script

Anonymous
Not applicable
597 Views
1 Reply
Message 1 of 2

Update Block attribute with Script

Anonymous
Not applicable

I need to update the attributes of number of sheets.  Basically  the revision status need to be updated for which I was trying to use the script which worked for some drawings.  However some are not getting updated for the one with dynamic blocks. Can anyone guide how to update the attributes using script in the dynamic block.

I am not sure how to attach the drawing here. if anyone can guide pls....

The drawing can be uploaded if required ... (Not sure how to upload in the forum)

0 Likes
598 Views
1 Reply
Reply (1)
Message 2 of 2

hencoop
Advisor
Advisor

Dynamic blocks often have anonymous names.  To avoid this stopping your script from reaching them, find the EffectiveName by examining the Object Data of your INSERT (block) selection.  If there is a way to use (SSGET) to select blocks by their EffectiveName I have not found it.  I have had to use (SSGET '((0 . "INSERT")(2 . "<actual block name>,`**")) and then examine each item in the selection set for INSERT objects with matching EffectiveName values.  (Note: The comma separates the two name values SSGET searches for.  '** searches for all anonymous block names.  The escape character ` is required before the * to find names beginning with *.).  I think a little bit of coding can make your script work and you can load and run lisp in your script.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes