Hello Pendean,
Thank you for your reply frist.
I found a lisp, from @hmsilva , from this post "https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-pdf-export/m-p/3807607#M309823".
With the help of this lisp I can print all layouts in one go to PDF. They also get the name of only the layouts themselves, which is what I want, and not "drawing-name"-"layout-name".pdf, but then they will all be printed with the same paper sizes and placed on my desktop.
A location that I want to change to the same location as my "default location for plot to file operations".
If I change this lisp (with my barely lisp knowledge), so that it only prints 1 layout instead of all layouts, my active layout jumps shortly to another layout first, prints it, and jumps back to my active layout.
For example, the drawing where I test this 1 layout plot lisp has 6 layouts. If layout2 is active then layout5 will be printed.
What is the reason why it jumps to a different layout for a short time.
And how do I change the read only "dwgprefix" location to my "plot to file" folder.
(defun C:printall (/ layouts num)
(setq layouts (layoutlist)); list all paperspace layouts in the drawing
(setq num 0); zero counter
(repeat (length layouts); Repeats the plot command on all layouts
(command ".-PLOT"
"Y" ;; Detailed plot configuration? [Yes/No] <No>: y
(nth num layouts) ;;Enter a layout name or [?] <Test_001>:
"DWG To PDF.pc3" ;;Enter an output device name or [?] <DWG To PDF.pc3>:
"iso a1 (594.00 x 841.00 mm)" ;;Enter paper size or [?] <iso a1 (594.00 x 841.00 mm)>:
"Millimeters" ;;Enter paper units [Inches/Millimeters] <Millimeters>:
"Landscape" ;;Enter drawing orientation [Portrait/Landscape] <Landscape>:
"No" ;;Plot upside down? [Yes/No] <No>:
"Layout" ;;Enter plot area [Display/Extents/Layout/View/Window] <Layout>:
"1:1" ;;Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <1:1>:
"0.00,0.0" ;;Enter plot offset (x,y) <0.00,0.00>:
"Yes" ;;Plot with plot styles? [Yes/No] <Yes>:
"kleur.ctb" ;;Enter plot style table name or [?] (enter . for none) <kleur.ctb>:
"Yes" ;;Plot with lineweights? [Yes/No] <Yes>:
"Yes" ;;Scale lineweights with plot scale? [Yes/No] <No>: y
"Yes" ;;Plot paper space first? [Yes/No] <No>:
"No" ;;Hide paperspace objects? [Yes/No] <No>:
(strcat (getvar "DWGPREFIX") (getvar "CTAB") ".pdf") ;; the pdf file with the layout name
"No" ;;Save changes to page setup [Yes/No]? <N>
"Yes" ;;Proceed with plot [Yes/No] <Y>:
);; end .-plot
(setq num (1+ num)); Increment counter
); end repeat
); end function
****************************************************************
(defun C:printA1 (/ layouts num)
(setq layouts (layoutlist)); list all paperspace layouts in the drawing
(setq num 0); zero counter
(command ".-PLOT"
"Y" ;; Detailed plot configuration? [Yes/No] <No>: y
(nth num layouts) ;;Enter a layout name or [?] <Test_001>:
"DWG To PDF.pc3" ;;Enter an output device name or [?] <DWG To PDF.pc3>:
"iso a1 (594.00 x 841.00 mm)" ;;Enter paper size or [?] <iso a1 (594.00 x 841.00 mm)>:
"Millimeters" ;;Enter paper units [Inches/Millimeters] <Millimeters>:
"Landscape" ;;Enter drawing orientation [Portrait/Landscape] <Landscape>:
"No" ;;Plot upside down? [Yes/No] <No>:
"Layout" ;;Enter plot area [Display/Extents/Layout/View/Window] <Layout>:
"1:1" ;;Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <1:1>:
"0.00,0.0" ;;Enter plot offset (x,y) <0.00,0.00>:
"Yes" ;;Plot with plot styles? [Yes/No] <Yes>:
"kleur.ctb" ;;Enter plot style table name or [?] (enter . for none) <kleur.ctb>:
"Yes" ;;Plot with lineweights? [Yes/No] <Yes>:
"Yes" ;;Scale lineweights with plot scale? [Yes/No] <No>: y
"Yes" ;;Plot paper space first? [Yes/No] <No>:
"No" ;;Hide paperspace objects? [Yes/No] <No>:
(strcat (getvar "DWGPREFIX") (getvar "CTAB") ".pdf") ;; the pdf file with the layout name
"No" ;;Save changes to page setup [Yes/No]? <N>
"Yes" ;;Proceed with plot [Yes/No] <Y>:
);; end .-plot
(setq num (1+ num)); Increment counter
); end function