=============================================================
Automate your plotting – reloaded
In the last post, we learned how to examine what we had previously written at the command line to write a script. We end up with this script to create an A1 PDF plot in our default plotting location:
-plot
y
DWG To PDF.pc3
ISO A1 (841.00 x 594.00 MM)
m
l
n
l
1:1
0.00,0.00
y
monochrome.ctb
y
n
n
n
n
y
ISO A1 (841.00 x 594.00 MM)
m
l
n
l
1:1
0.00,0.00
y
monochrome.ctb
y
n
n
n
n
y
To write the same routine as a macro, we would put it all on one line, like this:
^C^C-plot;y;;DWG To PDF.pc3;ISO A1 (841.00 x 594.00 MM);m;l;n;l;1:1;0.00,0.00;y;monochrome.ctb;y;n;n;n;;n;y;
Note that, instead of a carriage return macros use the semi-colon to indicate where you would usually press return on your keyboard. Spaces are also interpreted as hitting the return key (just like when you are operating AutoCAD manually). However, using spaces can make your code difficult to read and debug so I suggest that you replace the spaces with semi-colons.
The ^C^C at the beginning of the command is equivalent to pressing ‘Esc’ on the keyboard twice. This should cancel any other commands that are running before your Macro runs. You can read more about the Syntax for AutoCAD Macros here.
沒有留言:
張貼留言