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: 

Help on API command to have outputs reflect updates made to the command inputs using parameters

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
2way3dtext
273 Views, 2 Replies

Help on API command to have outputs reflect updates made to the command inputs using parameters

This command creates a pipe along a selected path and a sphere at both ends.

Is there a way to modify the code so that when a set value for the pipe diameter is changed, the diameter of the pipe body (and spheres) also changes automatically?

 

I tried using a parameter to change command inputs. I first created a parameter value and set it equal to 5mm. Then, the parametric value was set as a diameter input for the command. After selecting a path, the command created a pipe with a diameter of 5mm. However, the diameter of the created pipe remained 5mm even after the parameter value was changed to 10mm.

 

May I receive some feedback on a possible solution to this problem?       

2 REPLIES 2
Message 2 of 3
kandennti
in reply to: 2way3dtext

Hi @2way3dtext .

 

We need to associate the user parameters with the sketch dimensions.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-716cfabe-74ff-435e-a3e2-45dc203b8719 

 

I've modified various parts of the code to make the association look like this.

linearDimension.parameter.expression = pipeDiameterIpt.expression

For detailed changes, please compare the attached file with the one you created yourself.

 

 

Also, on a different note, if I do the following in the ExecutePreviewHandler, the Execute event will not be fired.

eventArgs.isValidResult = True

This is commented because it is useless.

Message 3 of 3
2way3dtext
in reply to: 2way3dtext

@kandennti

 

Thank you so much for inspecting and revising my code.

 

I searched through the fusion 360 homepage for a solution, but I was unable to find any leads before your reply.

 

Thank you again for your generous time and help.

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