VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

plotting of all layouts in pdf

3 REPLIES 3
Reply
Message 1 of 4
doctorcriso
175 Views, 3 Replies

plotting of all layouts in pdf

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
3 REPLIES 3
Message 2 of 4
ed57gmc
in reply to: doctorcriso

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

Message 3 of 4
doctorcriso
in reply to: doctorcriso

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
Message 4 of 4
ed57gmc
in reply to: doctorcriso

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report