Display full version of the post: Using A Script To Update Block In Multiple Files

NTGS
20.08.2019, 18:24

Hello,I am trying to write a script that updates an existing block in a drawing. I then plan on using ScriptPro to run the script across multiple drawings that have the block inside. Found the following script from this article - https://www.cad-notes.com/how-to-update-autocad-block-in-multiple-files-using-script/-INSERTtitle=(COMMAND \E "RESUME")QSAVE"title" is the block name .I run the script through ScriptPro and it doesn't update the blockI get this message in the log file:"title" = Warning: If you are trying to insert the file: "title" it must be inserted using the <block> = <filename> syntax. Command: y Unknown command "Y". Press F1 for help. Command: _. quit Command: **** No System Variable Changed ****Could anyone knowledgeable about scripts let me know what I am doing wrong or suggest a better method?Thanks

rebellio
21.08.2019, 08:01
Seems to work fine by me.Did you defined the path location for that block via options-->files--->Support File Search Path?

NTGS
21.08.2019, 10:06

Yeah I defined the path location. What version of AutoCAD are you using?

rebellio
21.08.2019, 10:39
Im using acad 2018

NTGS
21.08.2019, 11:05

I think I know the issue, the script works for me when I have a block with no spaces in its title. But when I have a block that has a space it doesn't work. When I run the script to update a block called Construction Stamp it assumes the block is called Construction.dwg. Do you know how to represent spaces in the script file for the block title?

rebellio
21.08.2019, 11:13
You were right it did not work, my mistake....Try this and be sure you have that last enter after the _qsave command-INSERTtitle=(COMMAND \E "RESUME")_QSAVEthis enter

rebellio
21.08.2019, 15:50
Other thing is that the block wont redefine because that script is inserting a block that is already in the drawing.......