[API BUG] Application.documentActivated Event do not raise

[API BUG] Application.documentActivated Event do not raise

akonovalenko
Contributor Contributor
1,968 Views
7 Replies
Message 1 of 8

[API BUG] Application.documentActivated Event do not raise

akonovalenko
Contributor
Contributor

Application.documentActivated Event does not raise when switching between Design and Drawing documents.
At the same time Application.documentActivating Event works fine.

In attachment you can find a test script and a short video which describes the issue


1,969 Views
7 Replies
Replies (7)
Message 2 of 8

JeromeBriot
Mentor
Mentor

Hello,

 

Did you try to execute this sample program: Application Event API Sample API Sample ?

 

On my machine, the documentActivated event works perfectly.

 

0 Likes
Message 3 of 8

akonovalenko
Contributor
Contributor

Yes, I am. Maybe it is a platform-dependent issue? I am working on Windows 10 environment.

And as you can see on my screencast the Application Event API Sample API Sample script does not raise documentActivated and documentDeactivated events when I switch between Drawing and Modeling tabs. 

 

 

 

0 Likes
Message 4 of 8

thomasa88
Advocate
Advocate

I see the exact same problem. I tried the API sample linked above.

Result:

* Drawing to Design or Design to Drawing: Only Activating and Deactivating events

* Design to Design: Activating, Activated, Deactivating and Deactivated events

 

2.0.8624
Active Plan: Fusion 360, Personal
Windows 10 (18362)

0 Likes
Message 5 of 8

thomasa88
Advocate
Advocate

Note: This makes it very hard to hide/show a panel depending on the document type.

0 Likes
Message 6 of 8

thomasa88
Advocate
Advocate

Has there been any progress on this issue? I have multiple add-ins where I have had to hook on to e.g. CommandTerminated to work around this.

0 Likes
Message 7 of 8

thomasa88
Advocate
Advocate

Sorry for spamming. Here is how to work around it in the mean time, I think (likely making Fusion 360 a tiny bit more slow with each add-in doing this, as the UserInterface.commandTerminated handler will trigger on every select and small user action).

 

def command_terminated_handler(args: adsk.core.ApplicationCommandEventArgs):
    # PLM360OpenAttachmentCommand, CurrentlyOpenDocumentsCommand are workarounds for DocumentActivated with Drawings bug.
    if (args.commandId in ('PLM360OpenAttachmentCommand', 'CurrentlyOpenDocumentsCommand')):
        # document activated

 

 

Message 8 of 8

zxynine
Enthusiast
Enthusiast

I just created a drawing document and swapped just as done in the video it appears as though this is no longer a problem. cool.

0 Likes