20 Posts
3 Kudos
Registered: ‎04-07-2010
Post 1 of 2

Publishing problem

147 Views, 1 Replies
07-24-2013 05:05 PM

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.




ADN Support Specialist
352 Posts
27 Kudos
Registered: ‎07-24-2007
Post 2 of 2

Re: Publishing problem

07-25-2013 03:07 PM in reply to: JohnDutz

we need reproducible sample code to understand the problem better

Fenton Webb

Developer Technical Services

Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!