changing name in distiller trough vba

Discussion in 'AutoCAD' started by mark the fox, May 13, 2004.

  1. mark the fox

    mark the fox Guest

    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
     
    mark the fox, May 13, 2004
    #1
  2. mark the fox

    bcoward Guest

    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, May 13, 2004
    #2
  3. mark the fox

    mark the fox Guest

    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
     
    mark the fox, May 14, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.