Wednesday, October 6, 2021

Change attribute order of block in many CAD drawings

To change attribute tag order in one drawing use BATTORDER (AutoCAD) or BATTMAN (AutoCAD and BricsCAD). With it you can update the block definition of the block.

battman

 

Then wblock out the block to a separate DWG file. In the example below it us C:\temp\TITLEBLOCK.dwg

In below example the block is named TITLEBLOCK so you will need to modify the name and path (separate folders with double backslashes). Save the AutoLISP code to an LSP file.

; redefine block with or without attributes from an external DWG block

(setq blockname " TITLEBLOCK")

(setq fullpath "C:\\temp\\TITLEBLOCK.dwg")

(if (tblsearch "block" blockname)

  (progn

    (command "_.-insert" (strcat blockname "=" fullpath) "_Y")

    (command)

    (command "_.attsync" "_N" blockname)

  )

)

Then you can use JTB SmartBatch to update all drawings with this LSP. Specify the use of the LSP in JTB SmartBatch Settings > Script/lisp file. Now add all drawings to be updated and you’ll have all title blocks or other blocks of your choice updated.

No comments:

Post a Comment

Subscribe to the comments feed

Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner

Contact Us | About JTB World | Subscribe to this blog
JTB World's website | Website General Terms of Use | Privacy Policy
^ Top of page

© 2004- JTB World. All rights reserved.