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: 

Moving focus

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
brad.bylls
271 Views, 3 Replies

Moving focus

When using the combine command, when the user selects the target body the focus automatically shifts to the tools selection box.

I have a similar UI and would like to know how that focus shift is done.

I tried the tab key but that does not work.

Thanks.

Brad Bylls
3 REPLIES 3
Message 2 of 4
nnikbin
in reply to: brad.bylls

@brad.bylls, in InputChangedEventHandler you can watch the changes of your SelectionCommandInput objects and if one of them changes and its selectionCount is greater than 0, switch the focus to the next SelectionCommandInput using SelectionCommandInput.hasFocus Property

Message 3 of 4
brad.bylls
in reply to: nnikbin

Thanks for the input (pun intended 8^)

I understand what you are saying, but I don't know how to code it.

Can you help.

 

    def on_input_changed(selfcommandinputschanged_inputinput_values😞

        if changed_input.id == 'target':
            selection_input = inputs.itemById('tool')
            selection_input.hasFocus
 
. . . . . . . . . . . . more code . . . . . . . . . . . .
 
        # Create the command dialog
        _inputSelectTargets = inputs.addSelectionInput('target''Select The Target Body''Select the Body\nThat Will Be Cut')
        _inputSelectTargets.addSelectionFilter(adsk.core.SelectionCommandInput.Bodies)
        _inputSelectTargets.setSelectionLimits(11)

        _inputSelectTools = inputs.addSelectionInput('tool''Select The Tool Bodies''Select the Bodies\nThat Will Do The Cutting')
        _inputSelectTools.addSelectionFilter(adsk.core.SelectionCommandInput.Bodies)
        _inputSelectTools.setSelectionLimits(0)
Brad Bylls
Message 4 of 4
brad.bylls
in reply to: nnikbin

Of course just after sending you the reply, I figured it out.

Thanks for the help and pointing me in the right direction.

Brad Bylls

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report