Jump to content

Trying to Automatically update/redefine block in Thousands of drawings


john_waggs

Recommended Posts

Good evening.

I'm hoping that someone here can come through for me with some programming assistance.

 

I currently need to update a gennote block numerous drawings in tons of different folders under one drive (F:\ drive).

 

I would like to get a routine that would start in the F Drive and Automatically go to each subfolder, open each drawing, insert 'gennotes=', erase "last", save the drawing, exit out, and go to the next drawing and do the same.

 

Then move on to the next folder and repeat the process until it makes it through all the folders and dwg files.

 

I started with a batch file that I cannot seem to get to work:

 

FOR /r %%f in (F:\*\*.dwg) DO START /WAIT

C:\"2012"\"Autocad 2012 - English"\acad.exe "%%f" /b

F:\scripts\gennotesupdate.scr

 

Gennotesupdate script:

 

Insert

gennotes=z:\blocks\gennotes

0,0 1 1 0

 

Erase L

 

Save

Y

 

____

That is all I have and Autocad opens but says it cannot find the specified files. I hit OK and autocad remains open. Nothing else happens.

 

If there's a better way to accomplish my task I would appreciate the assistance. Or if this is the best way, any tweaking to make this work would be appreciated.

 

Thanks,

 

John W.

Link to comment
Share on other sites

Thanks Dadgad but the Google says the link below is invalid and cannot locate.

 

Welcome to CADTutor. :)

 

Check out this lisp from Lee Mac

http://www.lee-mac.com/scriptwriter.html

 

it is but one of a great many which Lee very generously makes available for free

on his site. Thanks Lee! :beer:

If this doesn't do it for you, check his other lisps for one that may.

Link to comment
Share on other sites

You don't need to Google it, it is an active link in the forum post, :huh:

just left click on it, and it will take you right there to Lee's lisp and his site.

Link to comment
Share on other sites

I would use AutoDesk ScriptPro which would get around using batch files - just search for all the dwgs you want & drag 'n drop them onto the scriptpro pane. Also, the ACAD console would run quicker, as it doesn't load the user interface. A very good entry on the topic is found at...

http://www.cadtutor.net/forum/showthread.php?76974-Up-and-Running-with-the-2013-Core-Console&p=519692#post519692

 

I would try adding a .dwg to the end of the drawing/block you want to insert, you could also add "" around the path.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...