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: 

Create two input windows

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

Create two input windows

I am try to create two input windows. 

The first is a drop-down input.

The user makes a selection and the window closes and another input window opens with information populated with information based on the user's input from the first window.

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

Hi @brad.bylls 

 

You can create two CommandDefinitions, one to get the user selection and one for showing the information.

On execution of your first command you can call the execute method of your second CommandDefinition using CommandDefinition.execute method.

 

If you prefer to not allow the user to run your second command directly, you simply should not add it to any toolbar or menu. Just create a CommandDefinition using CommandDefinitions.addButtonDefinition method.

 

I think the simplest way to pass information between the two commands is creating add-ins instead of scripts. Add-ins stay active, so you can share the information between its commands.

Also usign UserInterface.commandDefinitions you can get the list of all commandDefinitions and get any commandDefinition using CommandDefinitions.itemById method.

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

I also suggest you think about using one window instead of two. Perhaps it will be feasible in your case. In many cases it will be enough to have just one window and control what is visible in it using isVisible property of different CommandInput objects (especially GroupCommandInput and TabCommandInput objects)

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

There is no button to mark as solved.

I tried on Chrome and Edge.

Thanks for the help.

Brad Bylls

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