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

changing name in distiller trough vba

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
158 Views, 2 Replies

changing name in distiller trough vba

Hi,
I've wrote some code to batch print all the layout in
a drawing but, but i would like to print them through acrobat distiller using the name of the layout as the file name.

thanks

M
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Mark,

If you've instantiated the Distiller object then I believe the FileToPDF method will require your filename.

FileName = LayoutName

9 out of 10 times I'm wrong so let us know.

Regards,

Bob Coward
CADS, Inc

800-366-0946
bcoward@mindspring.com
Message 3 of 3
Anonymous
in reply to: Anonymous

Thanks for your answer, I did not instantiated the Distiller object. I'm really a newbie with vba , I was able to print all my layout to a normal printer but when i tried to use the distiller I had to specify the name for each layout (50+). what i would like to do use the name of the layout as pdf name.


this the code that I've wrote ::

Sub PlotLayouts()
Dim Plot As AcadPlot
Dim AddedLayouts() As String
Dim LayoutList As Variant
Dim Layout As AcadLayout
Dim ArraySize As Integer
Dim BatchCount As Integer

For Each Layout In ThisDrawing.Layouts
If Layout.Name <> "Model" Then
ArraySize = ArraySize + 1
End If
Next

ReDim AddedLayouts(1 To ArraySize)
ArraySize = 0

For Each Layout In ThisDrawing.Layouts
If Layout.Name <> "Model" Then
ArraySize = ArraySize + 1
AddedLayouts(ArraySize) = Layout.Name
End If
Next

If ArraySize = 0 Then Exit Sub
LayoutList = AddedLayouts
Set Plot = ThisDrawing.Plot
Plot.StartBatchMode ArraySize
For BatchCount = 1 To ArraySize
Plot.SetLayoutsToPlot LayoutList
Plot.PlotToDevice "C:\Program Files\Acad2000\plotters\pdf-dwg.pc3"
Next
end sub

thanks
M

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

Post to forums  

Autodesk Design & Make Report

”Boost