File Not Found Error

Discussion in 'AutoCAD' started by Steven Craig Basham, Jan 19, 2004.

  1. Hello! I'm hoping someone has an idea why I'm receiving this error
    message... File Not Found.
    It does not happen every time my app runs... but enough to concern me. The
    strange thing is I don't believe my code should be looking for any files
    whatsoever... :( After the error message, the program continues on and
    executes the way I expected it to. So I'm not sure what this is... any
    help in fixing this bug would be greatly appreciated!

    Here is the code and where I receive the error message:

    Public Sub PlotDrawing(layoutlist As Variant, mylayout As AcadLayout, myPLOT
    As PlotCfg)
    Dim oPlotConfig As AcadPlotConfiguration
    Dim originalPLOTCfg As AcadPlotConfiguration
    Dim oPlot As AcadPlot
    On Error Resume Next
    Set oPlotConfig = ThisDrawing.PlotConfigurations.Add("TempPC", False)
    <<<<=== This line causes a "FILE NOT FOUND" error.... which I don't
    understand at all.
    With oPlotConfig
    .ConfigName = mylayout.ConfigName
    .StandardScale = mylayout.StandardScale
    .PlotRotation = mylayout.PlotRotation
    .ShowPlotStyles = mylayout.ShowPlotStyles
    .ScaleLineweights = mylayout.ScaleLineweights
    .PlotWithPlotStyles = mylayout.PlotWithPlotStyles
    .StyleSheet = mylayout.StyleSheet
    End With
    With mylayout
    .ConfigName = myPLOT.PlotDevice
    .RefreshPlotDeviceInfo
    .PaperUnits = acInches
    .CanonicalMediaName = myPLOT.CanonicalMediaName
    .GetWindowToPlot myPLOT.WindowStart, myPLOT.WindowEnd
    .StandardScale = ac1_1
    .PlotRotation = myPLOT.BorderOrientation
    .ShowPlotStyles = False
    .ScaleLineweights = False
    .PlotWithPlotStyles = True
    .StyleSheet = myPLOT.StyleSheet
    End With
    Set oPlot = ThisDrawing.Plot
    With oPlot
    .SetLayoutsToPlot (layoutlist)
    .NumberOfCopies = 1
    End With
    retVAL = oPlot.PlotToFile(myPLOT.Path)
    If retVAL Then
    Debug.Print "Plot was successful!"
    Else
    Debug.Print "Plot FAILED!"
    End If
    With mylayout
    .ConfigName = oPlotConfig.ConfigName
    .StandardScale = oPlotConfig.StandardScale
    .PlotRotation = oPlotConfig.PlotRotation
    .ShowPlotStyles = oPlotConfig.ShowPlotStyles
    .ScaleLineweights = oPlotConfig.ScaleLineweights
    .PlotWithPlotStyles = oPlotConfig.PlotWithPlotStyles
    .StyleSheet = oPlotConfig.StyleSheet
    End With
    oPlotConfig.Delete
    End Sub
     
    Steven Craig Basham, Jan 19, 2004
    #1
  2. Steven Craig Basham

    Mark Propst Guest

    I think it's looking for your pc3 file "TempPC.pc3"
    maybe check the support paths on the machine where you get that error?
     
    Mark Propst, Jan 19, 2004
    #2
  3. I was under the impression that I'm CREATING a plot configuration here, not
    looking for one. Can anyone verify this for me?
     
    Steven Craig Basham, Jan 19, 2004
    #3
  4. Steven Craig Basham

    Ed Jobe Guest

    Its a little confusing at first, but I think Mark was referring to the pc3
    file referenced by the ConfigName property, not the PlotConfiguration
    object.
     
    Ed Jobe, Jan 19, 2004
    #4
  5. Steven Craig Basham

    Mark Propst Guest

    oops
    :--)
     
    Mark Propst, Jan 19, 2004
    #5
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.