Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Toolbars - NEW UI

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
MichaelT_123
481 Views, 4 Replies

Toolbars - NEW UI

Hi TF360,

 

I tried recently to use some Addin(s) I have written in the ERA of OLD interface.

To no avail…

I have searched (only) a little bit through the code, but I could not find the problem.

The next move was to look at F360 documentation, particularly related to the recent change of UI (toolbars).

I have found the relaxing statement there:

Although the commands are organized differently, the commands themselves are not changed by the toolbar update

The following step was to run F360 supplied script allowing to spool the entire user interface command set.

 (http://help.autodesk.com/cloudhelp/ENU/Fusion-360-API/files/WriteUserInterfaceToFile_Sample.htm)

It has produced this result:

#---------------------------------------------------------------------------------------------------

Failed:

Traceback (most recent call last):

  File "D:/Fusion360/API/Scripts/SpoolControls/SpoolControls.py", line 50, in run

    msg = '   ' + workspace.id + ' (' + str(workspace.toolbarPanels.count) + ')____\n'

  File "…/Autodesk/webdeploy/production/…dd09c95/Api/Python/packages\adsk\core.py", line 13624, in _get_count

    return _core.ToolbarPanels__get_count(self)

RuntimeError: 2 : InternalValidationError : tb

The above exception was the direct cause of the following exception:

SystemError: <built-in function delete_Workspaces> returned a result with an error set

#---------------------------------------------------------------------------------------------------

Could you please check/clarify the problem?

Are there any changes/refinements necessary to OLD ADDIN SCRIPTS?

 

Regards

MichaelT

 

MichaelT
Tags (2)
4 REPLIES 4
Message 2 of 5
kandennti
in reply to: MichaelT_123

Hi MichaelT_123.

 

・・・
        result += '\n\n** Workspaces  (' + str(ui.workspaces.count) + ')____\n'
        for workspace in ui.workspaces:
            if workspace.productType == '':
                continue
            try:
                msg = '   ' + workspace.id + ' (' + str(workspace.toolbarPanels.count) + ')____\n'
                result += msg
                for panel in workspace.toolbarPanels:
                    msg = '      ' + panel.id + '\n'
                    result += msg
            except:
                pass
・・・
Message 3 of 5
MichaelT_123
in reply to: kandennti

Hi Kandennti-san,

 

<try: - except:> is a brutal trick... but it works ... most of the time :).

 

So, it seems that newly introduced  workspace(s) code is missing some classes, doesn't it?

I hope that it would be quite easy to patch the gap to make the statement :

Although the commands are organized differently, the commands themselves are not changed by the toolbar update

once again truthful.

 

With Regards

MichaelT

 

 

MichaelT
Message 4 of 5
kandennti
in reply to: MichaelT_123

Excuse me. Last night I was sleepy and forgot the text.
The cause seems to be the NEST workspace.
2.png

It seems that the NEST workspace tool panel is only implemented. However,
it may not be available.(Not tried)

I tried using the len function instead of the count property.
・・・
        result += '\n\n** Workspaces  (' + str(ui.workspaces.count) + ')____\n'
        for workspace in ui.workspaces:
            if workspace.productType == '':
                continue
            msg = '   ' + workspace.id + ' (' + str(len(workspace.toolbarPanels)) + ')____\n'
            result += msg
            for panel in workspace.toolbarPanels:
                msg = '      ' + panel.id + '\n'
                result += msg
・・・
3.png
Message 5 of 5
MichaelT_123
in reply to: kandennti

Great analysis Kandennti-san,

 

... even Sherlock Holmes could not has done better!

 

With Regards

MichaelT

 

MichaelT

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report