Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

How to properly use: setFeatureComputedParameter()

john_mcclaryjohn_mcclary Member, Developers Posts: 3,936 PRO
What am I missing?
This is all the info I see in the documentation

I've tried many times, but I cannot get the feature name to stick like I've seen in measureValue.fs and variable.fs




Best Answers

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    Answer ✓
    FYI, in order to use #someValue in templates, you need either definition.someValue to be a parameter or setFeatureComputedParameter("someValue", ...). No need for both, but setFeatureComputedParameter is still useful for computed values that aren't inputs.

    And yes, an individual feature's name and template are assigned when the feature is created, so if you're debugging this stuff and changing the feature name or template, you need to delete and recreate the feature in order to see the new name or template take effect.

Answers

  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,936 PRO
    Ok, so you also need to delete the feature and re-create it.
    I was running in circles expecting the feature tree to update just by editing the feature.

    Good to know you don't need setFeatureComputedParameter
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    Answer ✓
    FYI, in order to use #someValue in templates, you need either definition.someValue to be a parameter or setFeatureComputedParameter("someValue", ...). No need for both, but setFeatureComputedParameter is still useful for computed values that aren't inputs.

    And yes, an individual feature's name and template are assigned when the feature is created, so if you're debugging this stuff and changing the feature name or template, you need to delete and recreate the feature in order to see the new name or template take effect.
Sign In or Register to comment.