AutoCAD/Script File - Modify Plot Style
Expert: Bill DeShawn - 11/6/2008
QuestionHello
I am not that familiar with script file but usually have enough knowledge to get by.
I have 2500 drawings which I need to modify the page setup of each one to point to a certain .ctb file.
I figured I could open 50 or at a time and run a script to update the drawings.
Since filedia 0 does not work with _pagesetup , how can right a script to modify the plot style?
Thanks
Chris
AnswerYou didn't say what version of AutoCAD you're running. I'm running 2006 and this works for me:
Create a drawing with all the page setup criteria that you want and save the page setup therein to a page setup name that you've never used before in any other project or drawing. Save the drawing away in a folder that you can access quickly and name it PAGESETUPS. Then add that folder to your Support File Search Path in Options;Files. In your script run PSETUPIN. That is the command you need to import page setups from other drawings. When you run the command, you will be asked for the page setup name. Then run the -plot command in the same script. When asked if you want a Detailed Plot configuration, type N for No. Then the layout name. If it's the current layout (current active TAB - including Model), you're in like Flynn (or Flint). You will not be able to run this with a script automatically on 2500 drawings if you have to select different layouts. If they're all in Model and Model is active, then this will work fine. If you need to use a layout name other than Model in your drawings and the name is consistent throughout all the drawings (like Layout1), but may not be "current" or "active" in the drawing, you can use the LAYOUT command in your script to set AutoCAD to make it current.
After the layout name is resolved the -plot command will ask you for the pagesetup name. Here is where you can use the page setup name that you put in the drawing that you just imported with PSETUPIN. AutoCAD will compare the parameters in the setup with your next responses. If you hit Enter, then the answers will be the same as the default choice displayed. That easy to imitate with a script by skipping a line (a hard return) represent a hit to the Enter key. Choose not to write the plot to a file. Save changes to Page Setup? "Y". Proceed with plot? "Yes" if you want to plot. "No" if you just wanted to change the setup.
The big roadblock here is if you need to plot in different layouts that have different names.
Play with the script on a couple of drawings after you get your pagesetup drawings in place and get the page setups working like they're supposed to. When you're confident it will run, then and only then should you attempt it on the group of 2500 drawings.
Give it a try and let me know how it goes.
Bill DeShawn
http://my.sterling.net/~bdeshawn