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.

I want to name my feature based on an intense calculation. How do I keep it efficient?

EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
A feature I'm working on can take a while to compute, and one of the outputs after all of that computation is a number that I'd like to include in the feature name. I think I need to use the "Feature Name Template" for this, but is there a way to feed it the number without having to calculate it all again in editing logic and feeding that to a hidden UI parameter?
Evan Reese

Best Answer

  • Konst_ShKonst_Sh Member Posts: 51 PRO
    Answer ✓
    First of all you can use setFeatureComputedPararameter() function. Also whatever you calculate in editing logic can be validated in feature body, and if initial data is not changed it can be reused - this how editing logic can be used for caching saving regen time of the feature when some subset of inputs is persistent enough and used in expensive computation.

Answers

  • Konst_ShKonst_Sh Member Posts: 51 PRO
    Answer ✓
    First of all you can use setFeatureComputedPararameter() function. Also whatever you calculate in editing logic can be validated in feature body, and if initial data is not changed it can be reused - this how editing logic can be used for caching saving regen time of the feature when some subset of inputs is persistent enough and used in expensive computation.
  • EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
    This is a great answer. setFeatureComputedPararameter() is what I needed, and the caching with editing logic is a bonus. I actually figured the cache one out on my own for a particularly heavy feature I worked on, which worked great but I didn't think of validating it in the feature somehow. Thanks!
    Evan Reese
Sign In or Register to comment.