Community
I'm just getting started in VBA programming.
I want to plot all the Layouts in a PDF File in a certain path.
example: I have 4 Layouts and I want to plot them in a single PDF file.
I hope you can help me
That's quite a common request. I would first do a search of this forum for sample code.
Dim ruta As String
ruta = "C:\UTILITARIOS\"
Dim layo As AcadLayout
For Each layo In ThisDrawing.Layouts
If layo.Name <> "Model" Then
ThisDrawing.ActiveLayout = layo
'CONFIGURACION DE HOJA PARA EL PLOTEO================
layo.RefreshPlotDeviceInfo
layo.ConfigName = "DWG to PDF.pc3"
layo.PlotRotation = ac0degrees
layo.StandardScale = acScaleToFit
layo.StyleSheet = "acad.ctb"
layo.PlotType = acLayout
ThisDrawing.Regen acAllViewports
Dim nombre As String
nombre = ruta & layo.Name & ".pdf"
ThisDrawing.Plot.PlotToFile (nombre)
End If
Next layo
you didn't say if you were able to get this to work. You would probably need to set BACKGROUNDPLOT to off. Also, VBA doesn't have a way to plot multiple layouts directly to file as one pdf. You will need to get access to a pdf library and use it's api to import all the pages into one file.
Can't find what you're looking for? Ask the community or share your knowledge.