Python Script - class MyDocumentCloseHandler

Python Script - class MyDocumentCloseHandler

isocam
Collaborator Collaborator
408 Views
2 Replies
Message 1 of 3

Python Script - class MyDocumentCloseHandler

isocam
Collaborator
Collaborator

Can anybody help?

 

I have the following in a Python script:

 

class MyDocumentOpenedHandler(adsk.core.DocumentEventHandler):

class MyDocumentSavingHandler(adsk.core.DocumentEventHandler):

class MyDocumentSavedHandler(adsk.core.DocumentEventHandler):

 

Does anybody know if there is one for MyDocumentClosing?

 

I am trying to catch a event when I close the document (Assembly/Part/Drawing).

 

Many thanks in advance!

 

Darren

0 Likes
Accepted solutions (1)
409 Views
2 Replies
Replies (2)
Message 2 of 3

jiri.manak
Contributor
Contributor
Accepted solution

Hi Darren,

search for Application in Reference Manual, there is a Application.documentClosing Event

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-4AE1C84D-1001-4D41-8FDF-CD477A23CAF7

hope it helps

best regards

Jiri

 

Message 3 of 3

Rushikesh.kadam
Autodesk
Autodesk

@isocam below are two events related to document close:

  1. Application.documentClosedhttps://help.autodesk.com/view/fusion360/ENU/?guid=GUID-1506BE9C-B6EE-4115-841B-C77F787D9FE1
  2. Application.documentClosinghttps://help.autodesk.com/view/fusion360/ENU/?guid=GUID-4AE1C84D-1001-4D41-8FDF-CD477A23CAF7

Here is a sample link that demonstrates different application events: https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-a445a970-997b-11e5-b40a-3417ebd3d5be. Look out for class MyDocumentClosingHandler and MyDocumentClosedHandler. Ignore the comments for these classes as they are incorrect. A ticket is created to correct these comments. 

Hope it helps.

 

------------------------------------------------------------------------------------------------------------------------------

If my reply was helpful, please click the "Accept as Solution" button. It helps others get the answer quickly! A "Like" is always welcomed.




Rushikesh Kadam
Senior QA Engineer
Quality Assurance
Autodesk, Inc.