Page Setups

Discussion in 'AutoCAD' started by Tim Riley, Oct 25, 2004.

  1. Tim Riley

    Tim Riley Guest

    I don't know if I'm stupid or just dumb but I can't get this to work. I'm
    trying to plot an EPS file of modelspace limits so I can then pass it
    through ghostscript, making pdf files. However, when I run this code it
    doesn't change any of the modelspace layout properties.

    Code:

    Public Function PlotToEPS(OutputFile As String) As Boolean
    Dim Layout As AcadLayout
    Dim Plot As AcadPlot
    Dim orig(0 To 1) As Double

    orig(0) = 0
    orig(1) = 0

    For Each Layout In ThisDrawing.Layouts
    If LCase(Layout.Name) = "model" Then
    With Layout
    .ConfigName = "PostScript.pc3"
    .CanonicalMediaName = "ANSI_B_(17.00_x_11.00_Inches)"
    .PaperUnits = acInches
    .PlotType = acLimits
    .StandardScale = acScaleToFit
    .PlotOrigin = orig
    .StyleSheet = "Ricoh.ctb"
    .PlotHidden = True
    .UseStandardScale = True
    .PlotRotation = ac90degrees
    .CenterPlot = True
    End With

    Set Plot = ThisDrawing.Plot
    Plot.PlotToFile OutputFile, "PostScript.pc3"
    Set Plot = Nothing
    PlotToEPS = True
    Else:
    PlotToEPS = False
    End If
    Next
    End Function


    Note: I use the "For Each Layout In ThisDrawing.Layouts" in case I never
    need to make this work with paperspace.

    ~Tim Riley
     
    Tim Riley, Oct 25, 2004
    #1
  2. Tim Riley

    jdinardi Guest

    Seems odd. Have you tried a simple test like just setting the config name then going to your drawing and checking that it actually worked?

    I have never needed to do this but have you tried using Layout.RefreshPlotDeviceInfo? From the help file:

    "Use the RefreshPlotDeviceInfo method before trying to change the ConfigName property. "
     
    jdinardi, Oct 27, 2004
    #2
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.