Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Quick Plot PDF Macro

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
smbrennan
2171 Views, 12 Replies

Quick Plot PDF Macro

I am writing Macros to quickly plot using a pre-defined page setup to implement into my company's ribbon that I've been building and constantly improving on. I'm writing macros, because that's all I currently know and don't have time to learn anything else right now.

 

My macro so far is this:
-plot;n;;<page setup name>;;\n;y;

 

It works fine, but when I execute, I have no control over WHERE the file is saved. The \ is allowing me to enter the PDF name, but not it's location.

How can I bring up the dialog to specify the PDF's save location AND name?

 

Thank in advance,

Shawn

Shawn B.

  ||    
To help improve Autodesk Products, please Click Here to Vote for ideas and submit your own.
Tags (2)
12 REPLIES 12
Message 2 of 13
jregier
in reply to: smbrennan

Set up a print configuration (saved printer setup name) of your pdf writer that does not prompt for file name or location, and specify a default file location folder.

The pdf generated will be placed in that folder to the name of the CAD file.

Then use rename (in a macro or lisp) to rename and move the default generated file to your specified file name and location.

You may have to add a pause loop in the routine, or an if statement that checks the file repeatedly until it's done writing (till the time and size of the file is the same) as it takes time for the pdf to generate and the routine may run on ahead depending on how you set up the program and (script calls and lisp).
Message 3 of 13
hmsilva
in reply to: smbrennan


@smbrennan85 wrote:
...

It works fine, but when I execute, I have no control over WHERE the file is saved. The \ is allowing me to enter the PDF name, but not it's location.

How can I bring up the dialog to specify the PDF's save location AND name?

...


Shawn,

using the "DWG To PDF.pc3", you can try something like this

-plot;n;;<page setup name>;;~;;y;

 

HTH

Henrique

EESignature

Message 4 of 13
smbrennan
in reply to: hmsilva

Does the tilda bring the prompt up? I am using the Dwg to PDF.pc3.

Thanks,
Shawn Brennan

Sent from my iPhone
Shawn B.

  ||    
To help improve Autodesk Products, please Click Here to Vote for ideas and submit your own.
Message 5 of 13
hmsilva
in reply to: smbrennan


@smbrennan85 wrote:
Does the tilda bring the prompt up? I am using the Dwg to PDF.pc3.
...

...

Hi Shawn,

the tilde will bring up the dialog.

 

Henrique

EESignature

Message 6 of 13
smbrennan
in reply to: hmsilva

Henrique,

That worked like a charm! However, it always wants to plot to 'My Documents'. Is there a way to set the prompt to appear at the last destination folder without having to manually browse?
Shawn B.

  ||    
To help improve Autodesk Products, please Click Here to Vote for ideas and submit your own.
Message 7 of 13
hmsilva
in reply to: smbrennan

I'm glad it worked, Shawn.

 

If REMEMBERFOLDERS is set to 1, it should open at the last  (dwg) saved path.

 

HTH

Henrique

 

EESignature

Message 8 of 13
smbrennan
in reply to: hmsilva

Ahhh, that's my problem. The variable WAS set to 1, but the drawing I was testing was a new drawing that had not been saved. I tested on a couple of previously saved drawings, and it came up with that DWG folder location by default.

Thanks!
Shawn
Shawn B.

  ||    
To help improve Autodesk Products, please Click Here to Vote for ideas and submit your own.
Message 9 of 13
hmsilva
in reply to: smbrennan

You're welcome, Shawn
Glad I could help

Henrique

EESignature

Message 10 of 13
m_rogoff
in reply to: hmsilva

This is great!

 

Do you know how to get the print preview to appear? I would not mind having to manually finish the plot from that screen if it kills the routine.

Message 11 of 13
hmsilva
in reply to: m_rogoff


m_rogoff wrote:

 

Do you know how to get the print preview to appear? I would not mind having to manually finish the plot from that screen if it kills the routine.


Something like this perhaps...

 

^C^C_.preview;-plot;n;;<page setup name>;;~;;y;

 

HTH

Henrique

EESignature

Message 12 of 13
m_rogoff
in reply to: hmsilva

Thanks Henrique. That works!

 

I made a minor adjustment (added a Y) to plot to file (*.plt)

Message 13 of 13
hmsilva
in reply to: m_rogoff

You're welcome, m_rogoff
Glad I could help

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost