I have a LiSP program that is just supposed to create a multi-Sheet PDF from the drawing layouts. It sort-of works in that it creates the PDF file, but it only prints the bottom left corners of the sheets due to scaling.
Here is the code:
(vl-load-com)
(setq dwgName (substr (setq str (getvar "dwgname")) 1 (- (strlen str) 4)))
(setq fileName (getfiled "Save As" dwgName "pdf" 1))
(command "UNDO" "m")
(setq acadObj (vlax-get-acad-object))
(setq acadDoc (vla-get-ActiveDocument acadObj))
; Get layouts collection from document object
(setq Layouts (vla-get-Layouts acadDoc))
(vlax-for layout Layouts
(vlax-put-property layout 'ConfigName "DWG to PDF.pc3")
(setq PaperSize "ISO_full_bleed_A3_(420.00_x_297.00_MM)")
(vla-put-CanonicalMediaName layout PaperSize)
(vla-put-PaperUnits layout 1) ;set units to mm
(vla-put-StandardScale layout 0) ;set the scale to 1:1
(vla-put-UseStandardScale layout 1)
(vla-put-plotrotation layout 0)
(command "regenall")
(vla-RefreshPlotDeviceInfo layout)
)
(command "_.-export" "PDF" "All" fileName)
(command "UNDO" "b")
(command "regenall")
(setq alertMsg (strcat fileName ".pdf\nHas been created"))
(alert alertMsg)
(princ)
I have tried changing PaperUnits, StandardScale, and UseStandardScale, but nothing gets me to the result I need in the attached picture (Scale 1:1 and units set to mm).
Thanks in advance for any help you can give me.
Mark