.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Publishing problem

1 REPLY 1
Reply
Message 1 of 2
JohnDutz
365 Views, 1 Reply

Publishing problem

I'm working on a plugin to import document control information into Sheet Set Manager when plotting and publishing.  So far, everything seems to work as expected, except for a few problems with the EndPublish event that I had to work around.

 

What I'm dealing with now, though, is some inconsistency in the way AutoCAD updates fields during the ExportPDF or ExportDWF commands.  From Publish or SSM, everything works as expected - the new data is imported into the Sheet Set Manager, and the appropriate fields (SheetSet.CurrentSheet.RevisionNumber and SheetSet.CurrentSheet.Purpose) in the drawing update accordingly.  When using the ExportPDF or ExportDWF commands, AutoCAD does not update the fields unless the drawing was saved immediately before being exported.  The PlotDate fields are updating, but the SSM fields are not.

 

I tried saving the drawing, but Database.SaveAs crashes AutoCAD during the CommandWillStart, AboutToBeginPublishing and AboutToBeginBackgroundPublishing events - as I would expect it to.

 

I've tried enumerating all of the paperspace objects (using PublishSheetEventArgs) during the BeginSheet event, and although I can confirm that the fields are being Evaluated, the PDF is showing the unedited values.  I've tried Regenerating the drawing during the AboutToBeginPublishing and BeginSheet events, to no avail.  It seems as though AutoCAD is publishing from a background copy of the drawing that is not available through the Editor/Database objects.

 

Perhaps I should be using a different method (other than Field.Evaluate()) to update fields from the BeginSheet event handler?  What is the correct way to enumerate all of the objects in paper space during the BeginSheet event?  Is there another way to ensure AutoCAD updates these fields?

 

Any help and/or ideas would be appreciated.

 

Thanks.

 

1 REPLY 1
Message 2 of 2
fenton.webb
in reply to: JohnDutz

we need reproducible sample code to understand the problem better




Fenton Webb
AutoCAD Engineering
Autodesk

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost