AutoCAD LT - Pagesetup macro

AutoCAD LT - Pagesetup macro

Jorosph
Explorer Explorer
780 Views
11 Replies
Message 1 of 12

AutoCAD LT - Pagesetup macro

Jorosph
Explorer
Explorer

I want to make a shortcut for page setup, since all of our drawings have the same layout. I was automating this in Autohotkey, but it proved too cumbersome. I found out I can do the same thing with the -PAGESETUP command, so I made this macro in Long String Editor:

 

^C^C_-Pagesetup;
Dwg To PDF.pc3;
ARCH Expanded D (36.00 x 24.00 Inches);
i;*l;n;l;f;c;y;
mbs.ctb;
y;a;

 

I marked where the code stops working and switches to user input with an asterisk (*).

Can anyone tell me why this won't work?

 

[ The subject line of this post has been edited to include the product name by @handjonathan ]

0 Likes
781 Views
11 Replies
Replies (11)
Message 2 of 12

pendean
Community Legend
Community Legend
What does the actual commandline error/prompt state? That's important to know too.
0 Likes
Message 3 of 12

Jorosph
Explorer
Explorer

there isn't an error, it just stops for user input at page orientation. The part I marked is where it's supposed to provide input for that step

Capture.PNG

0 Likes
Message 4 of 12

pendean
Community Legend
Community Legend
@Jorosph Are you new to AutoCAd by chance? I may have assumed too much, forgive me.

Use the keyboard CTRL+F2 key combination to see more than one single line at the commandline, OR expand the commandline to be 3-4-5-10 lines tall as you test your macro to find out what might actually be going on.

Give it a try, post a new screenshot showing your full macro run until it stops. It's how we all do it.
0 Likes
Message 5 of 12

Jorosph
Explorer
Explorer

Opening an AutoCAD LT 2018/AutoCAD 2018 format file.
Substituting [simplex.shx] for [AIA Sans].
Regenerating model.
*Cancel*
Command:
Autodesk DWG. This file is a TrustedDWG last saved by an Autodesk application or Autodesk licensed application.
Command:
Command:
Command:
Command: _-Pagesetup
Enter an output device name or [?] <DWG To PDF.pc3>:
Enter paper size or [?] <ARCH full bleed D (36.00 x 24.00 Inches)>: Dwg To PDF.pc3
<Dwg To PDF.pc3> not found.
Enter paper size or [?] <ARCH full bleed D (36.00 x 24.00 Inches)>:
Enter paper units [Inches/Millimeters] <Inches>:
Enter drawing orientation [Portrait/Landscape] <Landscape>: ARCH
Invalid option keyword.
Enter drawing orientation [Portrait/Landscape] <Landscape>: *Cancel*

0 Likes
Message 6 of 12

Jorosph
Explorer
Explorer

Just new to macros.

0 Likes
Message 7 of 12

pendean
Community Legend
Community Legend

@Jorosph wrote:

Just new to macros.


No worries, we all started the same way.

 

Get in the habit of carefully reading what the commandline is trying to tell you: if you cannot read with comprehension, you can't customize very well or efficiently.

 

In this case you responded in your MACRO with an answer that was not from the short list that entry was looking for (in other words it asked for Portrait/Landscape but your macro answered ARCH)

 

pendean_0-1665434893539.png

 

Test it out and try again. you're doing great so far, you just need to understand what the program is telling you is going wrong.

0 Likes
Message 8 of 12

Jorosph
Explorer
Explorer

So, the reason it's doing that is because it's skipping over the first question entirely. Where it's supposed to enter "DWG to PDF.pc3" it just skips the question. that's why it enters ARCH, because it's part of the paper type. But why is it doing that? Why won't it enter the output device in the first place?

0 Likes
Message 9 of 12

pendean
Community Legend
Community Legend

My bad, I did not follow my own advice of reading through the prompts thoroughly either.

Your macro failed at the beginning, you (and I in this case) missed this important fact in macros: blank spaces are the same as <enter> in macro writing.

 

Aren't you basically trying to replicate this tip

https://www.cad-notes.com/how-to-automate-autocad-with-command-macros/

 

 

 

 

 

0 Likes
Message 10 of 12

h_s_walker
Mentor
Mentor

Put your items with spaces inside quotation marks e.g.

"DWG To PDF.pc3"

Then try the macro again

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 11 of 12

Jorosph
Explorer
Explorer

So now that I have everything set up, it only works some of the time. It doesn't recognize the chosen paper type occasionally. Its the same as before, but this time the error is actually on the paper type line. Is there some way to force it or just skip that step if it doesn't work?

 

Command:
Command: _-PAGESETUP
Enter an output device name or [?] <C:\Users\clay\AppData\Roaming\Autodesk\AutoCAD LT 2019\R25\enu\plotters\DWG To PDF.pc3>: "Dwg To PDF.pc3"
Enter paper size or [?] <ANSI_expand_A_(11.00_x_8.50_Inches)>: ARCH D (36.00 x 24.00 Inches)
<ARCH D (36.00 x 24.00 Inches)> not found.
Enter paper size or [?] <ANSI_expand_A_(11.00_x_8.50_Inches)>: I
<I> not found.

... [continues like this for the rest of the macro]

 

When I have that paper size already pulled up, the macro works fine, but that takes the purpose out of it.

0 Likes
Message 12 of 12

h_s_walker
Mentor
Mentor

@Jorosph Can you post the actual code you have written down so we can test it. Also we will need a list of the paper sizes from your DWG to PDF.pc3 file, but looking at your text above for the page size try putting underscores instead of spaces because that's what its' default page is showing

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes