Community
Dynamic Blocks Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change block reference in many drawings

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
Anonymous
4982 Views, 10 Replies

Change block reference in many drawings

Hi,

 

I am new user of AutoCAD. The version I am using is 2014. The problem I am having now is to replace logo in title block with another company logo for over several hundred drawings. Is there any way to make batch change instead of updating a single drawing several hundred times? BTW, the title block is not Xref, it is just a block referenced.

 

Thank you!! 

10 REPLIES 10
Message 2 of 11
Libbya
in reply to: Anonymous

Create a new external block file with the necessary changes.  Use 'redefine' to change the block definition.  I imagine you could create a simple lisp file that would run the redefine command and redefine the correct block with the updated block file definition, add it to your startup suite temporarily and then open/close each of the files to complete the update.  

Message 3 of 11
Anonymous
in reply to: Libbya

Thank you for your instant reply! Libbya, it seems too complicated to me.Smiley Sad

Message 4 of 11
Libbya
in reply to: Anonymous

I don't think you'll find any solution that is less complicated.  What part do you have trouble with?  I just did a quick search and it is certainly possible to redefine a block from a block file using lisp.  With 600 files to change it would be worth the small time involved to get it working, but you could also use the tool palette.  Save the updated block in a file, drag it to the tool palette.  Then open a file where you want to update the block, right-click the newly made tool palette tool, and select 'redefine'.  Save/close the file.  Do the same another 599 times...

Message 5 of 11
Anonymous
in reply to: Libbya

Hi Libbya,

 

My question is "how can I update the logo(block) in 600 drawings in one shot? " Your solution is only for updating logo(block) in single drawing, then repeat 600 times, it is tedious.

Message 6 of 11
Libbya
in reply to: Anonymous

I do not know a way to automatically update a batch of drawings without at least opening and saving/closing each drawing.  I said in my first post how to do to set it up so that all you would need to do is open/save/close each drawing and you said it was 'too complicated'.  I don't know what you are expecting.  You will either have more complication in setting up a process or more work with each individual drawing.  If you are wanting a solution that will do a batch update of all drawings, you are asking on the wrong forum.  You should be posting to one  of the Autocad Customization programming forums.  

Message 7 of 11
Anonymous
in reply to: Libbya

Hi Libbya,

 

I heard Xref has feature of batch change. So I thought there may be a way for block reference as well. Thank you very much for your patience. I will take your solution. Still, I can't imagine if a company wish to change static block in thousand of drawings.....

Message 8 of 11
Libbya
in reply to: Anonymous

An x-ref is an external file that is referenced within another drawing.  When the external file is changed, that change is shown in every host drawing (after reloading).  Blocks are not external references.  Their individual definitions are saved within each individual host drawing.  Because the individual files are not looking externally for the block definition, you need to change each individual file.  There is no getting around that.  I think it would be worth your time to ask on the customization forums to see if there is a way to program the batch file change but I do not believe it is possible without some programming.

 

Every office that I have worked for has used x-refs for items that are likely to need batch changes (e.g. titleblocks) specifically for this reason.  If a company wishes to change a block definition in 1,000 drawing files, that seems to me to be an example of poor cad management.  

Message 9 of 11
Anonymous
in reply to: Libbya

Libbya, many thanks to you. You are right, programming might be a solution...however, I don't know how to write script.

Message 10 of 11
m_rogoff
in reply to: Anonymous

The link below may be helpful to you. I have used it for several different issues. It basically creates a Windows batch routine that will open a file in Autocad in a specified folder, run a script upon opening Autocad, run a lisp, close and save, then repeats with the next file in that folder. I let it run overnight.

 

You could write a simple insert and replace lisp (or macro) if you are using a block for the logo

 

If it's Xref'd, you can just save the new logo with the same name and overwrite the old logo, then each time you open a file, the referenced logo image/block will be current.

 

http://www.widom-assoc.com/AU-CP12-3L.pdf

 

Message 11 of 11
Anonymous
in reply to: Anonymous

Don't know if you got an answer from the customization group, but here's a ham-handed sledge-hammer approach.

 

First is the logo a nested block within the titleblock?  If so, we'll need to redefine that (and rename it), if not we'll have to redefine the titleblock itself and possibly rename it.

 

Short version of the procedure,

assuming the original block is named OLD_Border and the new titleblock is named NEW_Border and is located in directory C:\Client\Borders\

 

1.) Edit the titleblock drawing NEW_Border.dwg to include the new logo (and any other changes) 

 

2.)  Create a short lisp function to redefine the block:

(command 
    "-insert" "OLD_Border=C:/Client/Borders/NEW_Border"
     (command)
)
(command 
    "attsync" "n" "OLD_Border"
    ".rename" "block" "OLD_Border" "NEW_Border"
    "qsave" "qsave" "close" "y"
)

That will redefine block OLD_Border to be exactly like drawing file NEW_Border.dwg, it will sync the block attributes (if any) to the new block definition, it will then rename the block, save the file twice and close the drawing.

 

3.) add that code to your ACADDOC.LSP file and make sure the path to that file is at the top of your search path.  That lisp function is loaded with every drawing, and note the code above is not a defined function itself, it just instructs AutoCAD to make some changes.  It will make those changes to EVERY file you open until you remove the code from ACADDOC.lsp

 

4.) execute AutoCAD and open ALL the files you want to repair (you might wish to do this in smaller groups of files)

AutoCAD will open each file, redefine the block, attsync the block, rename the block, save and close the file, then move to the next file selected.

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

NOTE#1:  Test the code on one drawing at a time to make sure it work and does what you expect it to do.  Leave out the "qsave" line until you are sure the rest of it works.  You can set up the function as a stand-alone command :

(defun c:fix-border ()
   (command 
       "-insert" "OLD_Border=C:/Client/Borders/NEW_Border"
        (command)
   )
   (command 
       "attsync" "n" "OLD_Border"
       ".rename" "block" "OLD_Border" "NEW_Border"
       "qsave" "qsave" "close" "y"
   )
)

Then you can test it by entering FIX-BORDER at the command line.  Once it runs like you want simply add the line:

(c:fix-border)

the the ACADDOC.lsp

 

NOTE#2: Notice the slashes in the file and the code, autolisp reads forward slashes as backslashes, if you want to use backslashes (copying the directory name from explorer) you need to use two: C:\\Client\\Borders\\NEW_Border

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report