Access name of Manufacturing Model that a setup is using

Access name of Manufacturing Model that a setup is using

BenHarper-3Dtek
Contributor Contributor
1,021 Views
6 Replies
Message 1 of 7

Access name of Manufacturing Model that a setup is using

BenHarper-3Dtek
Contributor
Contributor

I am attempting to find the name of the Manufacturing model that a setup is linked to.

 

When making a setup manually through the Manufacturing environment, there is a drop-down in the setup creation modal window to select from the available manufacturing models.  However, I cannot find where this data is stored in the setup object in the API.

 

You can access the model data that is selected immediately below this drop-down through setup.models.

Though these are of different types depending on what is selected and  I can't seem to climb back up the tree from one of these objects to see the name of the manufacturing model they live in.

 

Can anyone tell me how to find the manufacturing model object/name from a given setup in the API?

 

 

0 Likes
Accepted solutions (1)
1,022 Views
6 Replies
Replies (6)
Message 2 of 7

jeff.pek
Community Manager
Community Manager
Accepted solution

Hi -

 

The dropdown in the setup dialog is associated with a parameter named "job_workingModel". So, you can access the name (internal name) of the manufacturing model by accessing the value of that parameter.

 

Hope this helps,

  jeff

0 Likes
Message 3 of 7

BenHarper-3Dtek
Contributor
Contributor

Jeff, Many thanks.

I cannot find this parameter anywhere on google, intellisense or looking over objects when debugging - so no idea how you came across it!  

But glad you did, any chance you can elaborate on how you put your hands on that value through the python API?

Cheers

 

0 Likes
Message 4 of 7

jeff.pek
Community Manager
Community Manager

You should be able to follow the examples that get the value of any arbitrary parameter via the API. This would be through the "Value" property of the parameter. Something like (from memory): setup.parameters.itemByName("job_workingModel").value.value.

 

I have "internal access", so was able to look up the value. For this one, it's hard to deduce what the parameter would be, since a proxy parameter, "job_workingModel_select" is what is shown in the UI, so when you hover over the dropdown, that's what you see there. It's possible, that that parameter could provide the value as well.

 

Jeff

 

Jeff

0 Likes
Message 5 of 7

BrianEkins
Mentor
Mentor

It can be tricky to determine the parameter you want to access. I think you'll find this useful. An add-in delivered with Fusion dumps a list of all the parameters associated with a setup, operation, or tool. To enable the add-in, run the "Scripts and Add-Ins" command, choose the "Add-Ins" tab, and scroll to the bottom of the list. Select "CAM_API_Utilities", check the "Run on Startup" check box so it will automatically be loaded the next time you run Fusion, and click the "Run" button.

BrianEkins_1-1713490745058.png

 

Now, you should see two new commands in the INSPECT panel. Running the "Export Parameters" command will let you choose a Setup, Operation, or Tool, and then it will dump out all the associated parameters into a text file. 

BrianEkins_2-1713490836149.png

 

 

 

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

BenHarper-3Dtek
Contributor
Contributor

Many thanks @BrianEkins & @jeff.pek for your help.

I can access and read the manufacturing model param values now - though not write to them.

I always get "Invalid enumeration value."   Looking into getChoices(), shows that only default is an acceptable option. This is confirmed by looking a the output from export parameters:

name: job_workingModel
title: Manufacturing Model
expression: "'MfgWorkingModel'"
isEditable: True
isEnabled: True
ChoiceParameterValue
value: MfgWorkingModel
choices:
name: <Default>, value: 'default'

 

I currently have 3 manufacturing models, why is it that the choiceparameter choices are not updated to include the other manufacturing models as valid choices.  Of course I can successfully select them in the setup dialog in fusion, but cannot set them via the API as its not in the list of acceptable values.

 

I have tried to set it with 

setup.parameters.itemByName("job_workingModel").ChoiceParameterValue = "\'default\'"
&
setup.parameters.itemByName("job_workingModel").ChoiceParameterValue = "\'MfgWorkingModel\'"
These do not error out but also do not take effect.
&

 

mmparam = setup.parameters.itemByName('job_workingModel')
choiceVal: adsk.cam.ChoiceParameterValue = mmparam.value
choices = choiceVal.getChoices()
choiceVal.value = "default" #THIS WORKS
choiceVal.value = "MfgWorkingModel" #Invalid enumeration value
choiceVal.value = "/'MfgWorkingModel/'" #Invalid enumeration value​

 

 
Yet other similar items with set/known values like
 

 

jobparam = setup.parameters.itemByName('job_type')
choiceVal: adsk.cam.ChoiceParameterValue = jobparam.value
choices = choiceVal.getChoices()
choiceVal.value = "milling"

 

do not have an issue.
 
Any ideas how I can get it to accept a manufacturing model that exists but isn't on the list?
 
 
 

 

 

0 Likes
Message 7 of 7

rolandas_vegis
Advocate
Advocate

Hi, I encountered the same issue. Did you find a way to achieve this?

0 Likes