Inconsistent OnNewEditObjectEvent response on first document opened

Inconsistent OnNewEditObjectEvent response on first document opened

nmunro
Collaborator Collaborator
427 Views
2 Replies
Message 1 of 3

Inconsistent OnNewEditObjectEvent response on first document opened

nmunro
Collaborator
Collaborator

Inventor 2015 SP1.

 

When the first document is loaded after opening Inventor, the OnNewEditObjectEvent fires (kAfter) after the document is supposedly opened. If this document is a part or assembly document, my Inventor Application instance (ivApp) shows that ActiveDocument has been set to the newly opened document. If the first document is a drawing, ivApp.ActiveDocument (and ivApp.ActiveEditDocument) are both still null at this point. That seems a rather large inconsistency and makes it difficult to perform setup work on the first document opened in the Inventor session. I can work around it but this is something that should work the same way for all document types.

 

Neil

 

        


https://c3mcad.com

0 Likes
428 Views
2 Replies
Replies (2)
Message 2 of 3

adam.nagy
Autodesk Support
Autodesk Support

Hi Neil,

 

Yes it seems that in case of opening a drawing when the new EditObject becomes a Sheet then inside the kAfter part of OnNewEditObject event the ActiveDocument and ActiveEditDocument are still referencing the previously active document (Nothing if nothing was open before)

 

In case of Part and Assembly documents the new EditObject becomes the document itself (whereas in case of a drawing document it's the Sheet), so maybe that's why the above two properties get set by the time the event is called with kAfter.   

 

I logged this in our system #54310

 

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 3

nmunro
Collaborator
Collaborator

Thanks Adam.

        


https://c3mcad.com

0 Likes