Hello All,
I was successful with pulling all of my userParameters from a design, converting them to JSON, then saving them to a file. Now that I have switched to a new design, I am trying to read that saved file, convert back from JSON to a nested dictionary, and then create userParameters using the info in that nested dictionary.
Everything works great up to the point where I try to create (ADD) a new userParameter. No matter what I use for parameters in the app.activeProduct.userParameters.add, I get...
TypeError: in method 'UserParameters_add', argument 3 of type 'adsk::core::Ptr< adsk::core::ValueInput > const &'
from...
design = app.activeProduct
userp=design.userParameters
result = userp.add('testing',123,'in','this is a test')
This is a static example of course. I reverted to this after the elements from my dictionary were throwing the same error.
Thanks!
Solved! Go to Solution.
Hello All,
I was successful with pulling all of my userParameters from a design, converting them to JSON, then saving them to a file. Now that I have switched to a new design, I am trying to read that saved file, convert back from JSON to a nested dictionary, and then create userParameters using the info in that nested dictionary.
Everything works great up to the point where I try to create (ADD) a new userParameter. No matter what I use for parameters in the app.activeProduct.userParameters.add, I get...
TypeError: in method 'UserParameters_add', argument 3 of type 'adsk::core::Ptr< adsk::core::ValueInput > const &'
from...
design = app.activeProduct
userp=design.userParameters
result = userp.add('testing',123,'in','this is a test')
This is a static example of course. I reverted to this after the elements from my dictionary were throwing the same error.
Thanks!
Solved! Go to Solution.
Solved by kandennti. Go to Solution.
Hi @garyTAC3Y -San.
The second argument must be a ValueInput object.
userp: adsk.fusion.UserParameters = design.userParameters
result = userp.add(
'testing',
adsk.core.ValueInput.createByReal(123),
'in',
'this is a test'
)
Hi @garyTAC3Y -San.
The second argument must be a ValueInput object.
userp: adsk.fusion.UserParameters = design.userParameters
result = userp.add(
'testing',
adsk.core.ValueInput.createByReal(123),
'in',
'this is a test'
)
Can't find what you're looking for? Ask the community or share your knowledge.