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: 

Is there any API to set NamedValues to parameters in command dialog without having to open it?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
vijay.shindeSLE5F
424 Views, 5 Replies

Is there any API to set NamedValues to parameters in command dialog without having to open it?

We are aware of API CommandDefinition.execute(input) & executeTextCommand("Commands.SetString parameter"); but for both these API requires dialog to be opened.

 

We are trying update values for command dialog parameters even before dlg is opened. Is it possible?

 

@MattWynn Can you please help us with this?

5 REPLIES 5
Message 2 of 6

It's not possible to execute a command and not have its dialog pop up.  What you want is API equivalent functionality that you can call.  For example, if you look at any of the extrude samples, you are defining all of the required inputs and then creating the extrusion.  There is an internal function that creates the extrude feature.  The command provides the user interface to gather the input and in the end, calls the function to create the extrude.  The API provides a programming interface to let you define the required input and then the API call the same internal function as the command.  The end result is the same but the interface to collect the input and call the function that does the work is different.  Obviously, when automating a process it's ideal to use the API interface because then you bypass the UI interaction, and it's much cleaner to use from a program.

 

Calling a command from the API is typically only done to work around problems where there may not be API support or when you want to start a command and then allow the user to interact with the dialog and finish the execution.

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

@vijay.shindeSLE5F I am not familiar with this part of the API, Brian is the best reference.


Matt Wynn
Senior Manager, Software Development, Fusion Fabrication
Message 4 of 6

Thank you @BrianEkins for your explanation. Now it has resolved most of my queries. 

I have found that we can set parameters of existing toolpaths using below API's.  

setup->parameters()->itemByName("job_programName")->expression("12345");
operation->parameters()->itemByName("tolerance")->expression("0.1mm");


Can you please let me know that whether Fusion 360 has API equivalent functionality to set parameters of command Dialogs(NEST Preparation, Setup, Create NEST Study, Pocket & 2D Contour) without having to display it?

Message 5 of 6

Setup, pocket and 2d contour use the same parameter system, which is very specific to CAM, as toolpaths.

 

Nest preparation and nest study do not use the same parameter system, so no for them.  There is no supported method for controlling the nest commands or dialogs with API.


Matt Wynn
Senior Manager, Software Development, Fusion Fabrication
Message 6 of 6

@MattWynn Thanks for information

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

Post to forums