Hello,
I've this simple function:
Dim acad As AcadApplication
Dim doc As AcadDocument
acad = Nothing
doc = Nothing
Try
acad = CreateObject("AutoCAD.Application")
acad.Visible = True
doc = acad.Documents.Open("c:\prova2_123.dwg", True, Nothing)
Dim docActive As AcadDocument = acad.ActiveDocument
'MsgBox(docActive.Name)
docActive.PaperSpace.Layout.PlotType = AcPlotType.acExtents
docActive.PaperSpace.Layout.StandardScale = AcPlotScale.acScaleToFit
docActive.PaperSpace.Layout.CenterPlot = True
docActive.PaperSpace.Layout.ConfigName = "DWG To PDF.pc3"
docActive.Plot.NumberOfCopies = 1
docActive.Plot.PlotToFile("c:\out.pdf")
Catch e As Exception
Console.WriteLine(e.Message)
Console.WriteLine(e.StackTrace)
End Try
But
docActive.Plot.PlotToFile return False. I don't know why
Inside AutoCAD I got this message:
Job: - Canceled
Job ID: 1
Sheet set name:
Date and time started: 22/07/2007 22.14.33
Date and time completed: 22/07/2007 22.14.33
UserID: user
Profile ID: <>
Total sheets: 0
Sheets plotted: 0
Number of errors: 0
Number of warnings: 0
No runtime error was generated, just not plot.
Sorry maybe is a stupid error, but I'm new to AutoCAD Programming and .NET Programming
I hope you can help me.
Thank you.
Alfredo