- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I have trialled writing a script and a batch file to carry out a series of tasks to a set of drawings in AutoCAD 2016.
The aim is to open the vendor supplied drawings, add a layer name, switch to a layout, insert a sheet border + attribute sheet, make defpoints the current layer and insert a single viewport, save & close.
Well the script works fine in a single drawing. However when I try to run the batch file, AutoCAD will open the file invoke the script and run as expected, then quit out of AutoCAD, then repeat for the next file, etc, etc.
Is there a way I can speed this up by not shutting down AutoCAD each time. My script trials using 'close' instead of 'quit' do not work, just stops after the first file has been converted.
My Script file (xxxlayer.scr) is as follows;
-Layer
_new
xxx
_m
xxx
-layout
_set
_zoom
_extents
-insert
KCA5-A3E-PCMC.dwg
0,0
1
1
0
_zoom
Extents
-insert
KCA5-A3EA-PCMC.dwg
0,0
1
1
0
-layer
_m
defpoints
_zoom
extents
-vports
20,43
410,287
qsave
quit
My Batch File is as follows;
FOR %%f in (C:\temp\*.dwg) do start /wait C:\"Program Files"\"Autodesk\AutoCAD 2016"\acad.exe "%%f" /b "C:\temp\xxxlayer.scr"
This is something new for me and am relatively pleased with how far I have progressed using information from this forum so far.
Looking forward to continuing to learn
Solved! Go to Solution.
