Community
Fusion Support
Report issues, bugs, and or unexpected behaviors you’re seeing. Share Fusion (formerly Fusion 360) issues here and get support from the community as well as the Fusion team.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bug Report: arguments in MarkingMenuEventHandler are missing (NoneType) for sub components

1 REPLY 1
Reply
Message 1 of 2
OceanHydroAU
89 Views, 1 Reply

Bug Report: arguments in MarkingMenuEventHandler are missing (NoneType) for sub components

This is a followup to my post in the other forum:  https://forums.autodesk.com/t5/fusion-api-and-scripts/bug-report-how-to-select-which-right-click-lin...

 

When users right-click on elements in the browser (e.g. on the "Bodies" of the root component), our MarkingMenuHandler receives a callback with an argument indicating what they right-clicked on (e.g. adsk::fusion::BRepBodies )

 

This works fine for the root component in the browser, however, for all submenus of any additional components in the browser, our MarkingMenuHandler receives a callback with only a single "NoneType" argument and no way to determine what the user right-clicked on.  (which might be "Bodies" or "Sketches" or "Flat Pattern" or "Origin" or "Construction" etc - always "NoneType" for those.)

 

You can reproduce and observe the bug with this sample code:-

 

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-c90ce6a2-c282-11e6-a365-3417ebc87622

 

find this line in the above:

setLinearMarkingMenu(args)

and insert this code after it:

 

try:
    if args.selectedEntities.size:
        print(args.selectedEntities.front().__class__.__name__)
except:
    pass

 

 

then create a new design, create a body inside that design, create a new component in the design, and create a body inside this new component, and the right-click on both of the "Bodies" items in the browser menu to see the bug on the second one

 

You will see this working:

pic_2024-04-02_16.04.46_409.png

says: adsk::fusion::BRepBodies

 

And this not working:-

pic_2024-04-02_16.05.16_410.png

says: NoneType

 

I hope you like my bug report!  Good luck!

 

Tags (1)
Labels (1)
1 REPLY 1
Message 2 of 2
OceanHydroAU
in reply to: OceanHydroAU

Additional information (possibly the same bug) - the selected entity is not exposed to the commands either for sub components only (root is OK)

 

Running the commands we added to the right-click menu result in adsk.core.Application.get().userInterface.activeSelections.entity being "None" (for subcomponents - the top-level root components work OK)

 

example code:-

 

        class CommandCreatedEventHandlerPanel(adsk.core.CommandCreatedEventHandler):
            def __init__(self, pnlid):
                super().__init__() 
            def notify(self, args):
                try:
                    app = adsk.core.Application.get()
                    ui = app.userInterface
                    print(ui.activeSelections[0].activeSelections.entity.objectType) # works for root, is None for components

 

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

Post to forums  

Autodesk Design & Make Report