Change select by mouse

Change select by mouse

-pezi-
Enthusiast Enthusiast
931 Views
4 Replies
Message 1 of 5

Change select by mouse

-pezi-
Enthusiast
Enthusiast

I have addIn and if CommandInputs with SelectionCommandInput is active, I can not change the mouse component selection from the tree (Browser). Only when I cancel the current selection can I change the selection. Selections directly in the model space work as expected. Do I make a mistake somewhere, or is it a Fusion property?

My code behaves just like solution:
https://forums.autodesk.com/t5/fusion-360-api-and-scripts/how-to-use-the-selectioneventhandler/m-p/6...

0 Likes
932 Views
4 Replies
Replies (4)
Message 2 of 5

BrianEkins
Mentor
Mentor

What type of objects are you filtering for in the SelectionCommandInput?  What's displayed in the browser are occurrences, not components.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 3 of 5

-pezi-
Enthusiast
Enthusiast

I have setting Occurrences as type of objects for filtering. Apology, for my bad describe in original question.

0 Likes
Message 4 of 5

BrianEkins
Mentor
Mentor

I added the line highlighted below to the command inputs sample and I can select occurrences in both the graphics window and the browser.  Can you double-check your code again?

 

            # Create a selection input.
            selectionInput = tab1ChildInputs.addSelectionInput('selection', 'Select', 'Basic select command input')
            selectionInput.addSelectionFilter('Occurrences')
            selectionInput.setSelectionLimits(0)
---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 5 of 5

-pezi-
Enthusiast
Enthusiast

Your solution is function for multiSelect, but i need select only one occurrence.

selectionInput.setSelectionLimits(1,1)

 

0 Likes