Error while plotting

Error while plotting

Anonymous
Not applicable
651 Views
1 Reply
Message 1 of 2

Error while plotting

Anonymous
Not applicable

I am using a C# class by Gile from the following url to plot multiple layouts to a single PDF file

 

https://forums.autodesk.com/t5/net/plot-dwg-to-pdf-for-multiple-layouts-in-c/td-p/5849145

 

However I get the error at the time of calling the Publish() method. Some of the layouts and trying to plot are created programmatically in the current drawing. Before plotting the layouts, the drawing is saved and reopened as follows:

 

 

// Save the drawing
newDoc.CloseAndSave(reportDwgName); newDoc = Application.DocumentManager.Open(reportDwgName, false); Application.DocumentManager.MdiActiveDocument = newDoc; // Print the layouts to PDF List<Layout> layouts = GetAllLayouts(); ReportPrinter.MultiSheetsPdf pdf = new ReportPrinter.MultiSheetsPdf(analysisFolder, layouts); pdf.Publish();

If I explicitly save the drawing using the AutoCAD UI then I don't get this error.

 

The plot log shown by AutoCAD tell me that the two layouts that were programmatically created and added to the drawing were not found.

 

I have attached the capture of the error I am getting.

 

I will really appreciate any help on this issue. Thank you!

 

0 Likes
652 Views
1 Reply
Reply (1)
Message 2 of 2

ambrosl
Autodesk
Autodesk

Can you share the code that is used to create the new layouts?  Do you get an error or a message when switching to the layouts using the AutoCAD UI? Have you checked the plot settings for the new layouts and made sure they are valid.



Lee Ambrosius
Senior Principal Content Experience Designer
For additional help, check out the AutoCAD Developer Documentation
0 Likes