plotting of all layouts in pdf

plotting of all layouts in pdf

doctorcriso
Explorer Explorer
363 Views
3 Replies
Message 1 of 4

plotting of all layouts in pdf

doctorcriso
Explorer
Explorer
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
0 Likes
364 Views
3 Replies
Replies (3)
Message 2 of 4

Ed__Jobe
Mentor
Mentor

That's quite a common request. I would first do a search of this forum for sample code.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 4

doctorcriso
Explorer
Explorer
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
0 Likes
Message 4 of 4

Ed__Jobe
Mentor
Mentor

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.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes