BLOCKUPDATE

Update block definitions in current drawing from a selected block library directory.

INTRODUCTION

If there is a block with the same name in selected block library folder, it updates the block definition in the drawing with the block in the library folder.

Command: BLOCKUPDATE

It will prompt you to select a block library folder.

It provide a brief summary at the end. For example, "9 blocks have been updated."

It also remains the original attribute value if the new attribute tag matches the old one.

LSP FUNCTION

Use command line function below in your script file to update multiple drawings.

(BLOCKUPDATE Path Blklist)

  • Path is the directory of the block library, such as "C:\My Block Library". If Path is nil, above "Browse for Folder" dialogue box will pop out to allow select a block library directory.

  • Blklist is a list of block names. Only these blocks will be updated. If Blklist is nil, it will update all blocks in the drawing.

Command function example:

(BLOCKUPDATE "C:\\My Block Library" (list "Window 1" "Door 890" "Titleblock"))

In the example above, only 3 blocks will be updated to blocks saved in the directory C:\My Block Library.

TIPS

  1. You can use BLOCKOUT to write the latest blocks to a library folder first, then use BLOCKUPDATE to update block definition in old drawings.

  2. You can add command line function to acad.lsp to specify which block is going to be updated whenever open a drawing.

NOTES

  1. This command is in BLOCKOUT.vlx

  2. It doesn't check the block version. As long as there is a block file with the same name as the one in current drawing, it will update it.

  3. You can add BLOCKOUT.vlx into the StartUp Suite or acad.lsp so it will be loaded automatically in every drawing. Here is how: How to automatically load LISP routines in AutoCAD.

  4. You can add following codes into your acad.lsp or acaddoc.lsp to run BLOCKUPDATE whenever a drawing is opened.
    Change Path and Blklist accordingly as explained above.

(defun s::startup ()
(BLOCKUPDATE Path Blklist)
)

UPDATES

8 July 2014 Resolved an issue which causes an error when running the routine.
26 June 2014 Block list is added as a new argument for the command line function.
19 June 2014 First upload.