The DocumentOpened event fires at the VERY end of a document being opened so the Document object is available to be used.
When a document is opened that references other documents, only the top-level document will cause the documentOpened event to be fired. You can access the referenced documents by using the documentReferences property of the Document object.
-------- Import ---------
-------- Global variables ---------
-------- Connect the handler to the event. ---------
-------- Event handler function definition ---------
|
-------- Global variables ---------
-------- Connect the handler to the event. ---------
-------- Event handler class definition ---------
|
--------- Required include files. ---------
--------- Event handler class definition and global declaration. ---------
class MyDocumentOpenedEventHandler : public adsk::core::DocumentEventHandler { public: void notify(const Ptr<DocumentEventArgs>& eventArgs) override { // Code to react to the event. ui->messageBox("In MyDocumentOpenedEventHandler event handler."); } } _documentOpened; --------- Connect the handler to the event. ---------
|