Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Need help with the plotting command in LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Greetings,
We need to use the DWG to PDF.pc3 with the -Plot command in a LISP script for batch printing to files.
The problem is that we need the users to select where they need to save the document, but the LISP command then select the next parameter during the save screen. For instance, if the parameter following the save dialog prompt is "No", it will save the file as "No" in the My Documents folder.
Here is what the line looks like at the moment (please note that this is working for the prompt with a printer like Adobe PDF but not DWG to PDF.pc3):
(COMMAND "_-PLOT" "OUI" "OBJET" "DWG TO PDF.PC3" FORMATP unite orient1 "NON" "L" P1 P2 FACTEUR "C" "OUI" "STAS_DESIGNJET.CTB" "OUI" "A" "NON" "NON" "OUI")
We are using AutoCAD Mechanical 2013 french.
Can you help us out please?
Thanks a lot for your time and help.
Solved! Go to Solution.
Re: Need help with the plotting command in LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
In AutoCAD and Civil 2013 this works for me:
(command "-plot"
"Yes" ;Detailed plot configuration? [Yes/No] <No>: Y
"" ;Enter a layout name or [?] <0_01a>:
"DWG To PDF.pc3" ;Enter an output device name or [?] <DWG To PDF.pc3>:
(substr PLOT_framesize 17) ;Enter paper size or [?] <ISO full bleed A3>:
"Millimeters" ;Enter paper units [Inches/Millimeters] <Millimeters>:
PLOT_rotation ;Enter drawing orientation [Por.../Lan...] <Lan...>:
"No" ;Plot upside down? [Yes/No] <No>:
"Window" ;Enter plot area [D.../E.../L.../V.../W...] <Window>:
PLOT_BL ;Enter lower left corner of window <0,0>:
PLOT_TR ;Enter upper right corner of window <420,297>:
"1=1" ;Enter plot scale or [Fit] <1=1>:
"Center" ;Enter plot offset (x,y) or [Center] <Center>:
"Yes" ;Plot with plot styles? [Yes/No] <Yes>:
"" ;Enter plot style table name or [?] <>:
"Yes" ;Plot with lineweights? [Yes/No] <Yes>:
"No" ;Scale lineweights with plot scale? [Yes/No] <No>:
"No" ;Plot paper space first? [Yes/No] <No>:
"No" ;Hide paperspace objects? [Yes/No] <No>:
PLOT_filename
"Yes" ;Save changes to page setup [Yes/No]? <N> y
"Yes" ;Proceed with plot [Yes/No] <Y>:
)
where PLOT_filename = (strcat (getvar "DWGPREFIX") (vl-filename-base (getvar "DWGNAME")) ".pdf")
i.e. the PDF is created with the same name and in the same folder as the DWG.
S
Re: Need help with the plotting command in LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Greetings,
Thanks for your answer, but what we actually need is to get the save dialog prompt to show up to manually select the location and type the filename as well.
Is it possible to do it that way?
Thanks again.
Re: Need help with the plotting command in LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
You can't get the dialogue box to show DURING the print process, but you could set the filename BEFORE the _PLOT command using (getfiled,
S
Re: Need help with the plotting command in LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Greetings,
Thanks a lot, it worked with getfiled.
Re: Need help with the plotting command in LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
licences,
using a tilde you can bring up the dialogue box
(COMMAND "_-PLOT" "OUI" "OBJET" "DWG TO PDF.PC3" FORMATP unite orient1 "NON" "L" P1 P2 FACTEUR "C" "OUI" "STAS_DESIGNJET.CTB" "OUI" "A" "NON" "~" "NON" "OUI")
I hope I have understood the French commands...
Henrique
Re: Need help with the plotting command in LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Greetings,
Thanks for your reply hmsilva, your solution works as well and does the same with less code. The dialog is a little bit different from getfiled, it can be edited (resized) and you can see the quick shortcuts on the left side (same as the save dialog used in AutoCAD). In our case, this will prove to be handy.
I gave you a "kudo" as I have already accepted the solution with getfiled.
Thanks again to both of you for your time and help.
Re: Need help with the plotting command in LISP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
You're welcome, licences

