[Bug]DrawingDocument is not active

[Bug]DrawingDocument is not active

kandennti
Mentor Mentor
448 Views
3 Replies
Message 1 of 4

[Bug]DrawingDocument is not active

kandennti
Mentor
Mentor

Keep the f3d and f2d files open and make the f3d file active.

 

Run the following script.

# Fusion360API Python script

import traceback
import adsk.fusion
import adsk.core
import adsk.drawing

def run(context):
    ui: adsk.core.UserInterface = None
    try:
        app: adsk.core.Application = adsk.core.Application.get()
        ui = app.userInterface

        app.log(f'ver {app.version}')
        for doc in app.documents:
            datafile: adsk.core.DataFile = doc.dataFile
            if datafile.fileExtension == 'f2d':
                doc.activate()
                
                app.log(f'activeDocument.name:{app.activeDocument.name}')

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

 

The text command window will output the following results.

 ver 2.0.12670
 activeDocument.name:Draw v1

 

However, the document tabs in the GUI do not have the f2d file active.

1.png

449 Views
3 Replies
Replies (3)
Message 2 of 4

Rushikesh.kadam
Autodesk
Autodesk

@kandennti apologies for the delay in response. I am able to reproduce the case. A bug is created and assigned to the concerned team. Thank you for reporting the issue.

 

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

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.


Message 3 of 4

kandennti
Mentor
Mentor
0 Likes
Message 4 of 4

kandennti
Mentor
Mentor

I have confirmed that this has been fixed in Ver 2.0.14104.
Thanks.

0 Likes