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

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

vijay.shindeSLE5F
Enthusiast Enthusiast
1,163 Views
5 Replies
Message 1 of 6

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

vijay.shindeSLE5F
Enthusiast
Enthusiast

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?

0 Likes
Accepted solutions (1)
1,164 Views
5 Replies
Replies (5)
Message 2 of 6

BrianEkins
Mentor
Mentor

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

MattWynn
Alumni
Alumni

@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
0 Likes
Message 4 of 6

vijay.shindeSLE5F
Enthusiast
Enthusiast

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?

0 Likes
Message 5 of 6

MattWynn
Alumni
Alumni
Accepted solution

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
0 Likes
Message 6 of 6

vijay.shindeSLE5F
Enthusiast
Enthusiast

@MattWynn Thanks for information

0 Likes