Sounds like a job (batch process a group of drawings) a script could handle.

Registered forum members do not see this ad.
Hi all,
I'm just starting to learn how useful AutoLISP can be and I want to ask if what I am trying to do is possible...
I have about 500 separate CAD drawings, all with the same layer names. Layer A, lets say, is currently yellow, I need it to be magenta.
I'm thinking I need to write something that will open each drawing, change the layer color, save it, then close the drawing? Is this a good direction to head?
This could just be done with a big long script right?
Thanks for the help, I'm going to keep researching about how to create autoLISP routines to edit this large database of drawings since it REALLY seems to beat the idea of editing each of them individually!
Sounds like a job (batch process a group of drawings) a script could handle.
"I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police
Eat brains...gain more knowledge!

Hi there,
So here is the script I'm trying to run:
which changes the layer color of the layer 'Guidelines' to magenta. This works fine with the command 'scr' on an individual drawing that I have open in AutoCAD. I wanted to use ScriptPro 2.0 to select the 500+ drawings I want this to act on but....ScriptPro doesnt seem to do anything.Code:-layer color magenta Guidelines qsave
I run ScriptPro and it opens up a blank AutoCAD program, but the drawings are unchanged.
I tried not using ScriptPro, but I am having trouble writing the script that opens up an existing drawing. It keeps trying to open the file, but a popup window says something like '...please verify the file exists'. Even though I am pretty sure I have the path correct.
Any idea what I'm doing wrong?
That is the extent of your script?
No command to open a drawing, or save and close the drawing?
"I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police
Eat brains...gain more knowledge!
I don't use ScriptPro so couldn't advise you in that respect, but to offer an alternative, here is an old program of mine that may help you:
http://lee-mac.com/scriptwriter.html
Excuse the terrible coding, the program needs a major overhaul!
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper

Yup, that's the extent of my script. I left out the open and close portions because I thought ScriptPro handled those portions. But I can put in the open and close portions like this:
But at this point I'm too lazy to copy the file paths for each drawing (LOTS of sub-directories there...) in place of "Drawing#". Which is why ScriptPro sounded so appealing. I'd love to figure this out so I can use it again in other situations. There aren't too many settings to tweak in ScriptPro, so I'm confused why its not working.Code:open "Drawing1" -layer color magenta Guidelines qsave close open "Drawing2" -layer color red Guidelines qsave close
Lee Mac, I can give your program a try when I get home tonight (they are pretty picky about what I can download here at work).
Thanks for the help
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
You don't have to copy the file path for each and every drawing. It's a batch file. As long as you point it to the right folder it will batch process the contents of the entire folder.
"I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police
Eat brains...gain more knowledge!
However, to my knowledge, the problem with using a Batch file to process drawings is that it will unnecessarily close and re-open the AutoCAD Application for every drawing processed; whereas, using only a Script to process drawings enables much faster processing since drawings can be opened and closed in a single instance of the Application.
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Registered forum members do not see this ad.
That is a good point Lee. I should have been more precise in what I was saying. Thanks.
"I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police
Eat brains...gain more knowledge!
Bookmarks