Print Page | Close Window

Using A Script To Update Block In Multiple Files

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=13268
Printed Date: 31.May.2026 at 21:31


Topic: Using A Script To Update Block In Multiple Files
Posted By: NTGS
Subject: Using A Script To Update Block In Multiple Files
Date Posted: 20.Aug.2019 at 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/" rel="nofollow -

QSAVE

"title" is the block name .

I run the script through ScriptPro and it doesn't update the block

I 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




Replies:
Posted By: rebellio
Date Posted: 21.Aug.2019 at 08:01
Seems to work fine by me.
Did you defined the path location for that block via options-->files--->Support File Search Path?


Posted By: NTGS
Date Posted: 21.Aug.2019 at 10:06
Yeah I defined the path location.
 
What version of AutoCAD are you using?


Posted By: rebellio
Date Posted: 21.Aug.2019 at 10:39
Im using acad 2018


Posted By: NTGS
Date Posted: 21.Aug.2019 at 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?


Posted By: rebellio
Date Posted: 21.Aug.2019 at 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

-INSERT
title=
(COMMAND \E "RESUME")
_QSAVE
this enter


Posted By: rebellio
Date Posted: 21.Aug.2019 at 15:50
Other thing is that the block wont redefine because that script is inserting a block that is already in the drawing....... 



Print Page | Close Window