Can Custom Feature Scripts Create Variables Automatically?

david_dalton526
david_dalton526 Member Posts: 3 ✭
edited October 2021 in Community Support
Would there be a way for me to create a feature script in which it will make a variable automatically with the only input from a person being the value. For ex. I'm trying to create a feature script to make bolt hole patterns that require an equation that uses multiple variables. I need to create variables that you can change when you open the feature script instead of opening every variable one at a time. If that is possible, would I be able to configure those variables inside of that feature script? 

Best Answer

  • NeilCooke
    NeilCooke Moderator, Onshape Employees Posts: 6,126 image
    Answer ✓
    Yes! setVariable can be used to create new variables from FeatureScript.
    Senior Director, Technical Services, EMEA

Answers

  • NeilCooke
    NeilCooke Moderator, Onshape Employees Posts: 6,126 image
    Answer ✓
    Yes! setVariable can be used to create new variables from FeatureScript.
    Senior Director, Technical Services, EMEA