Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
Is there a way of excluding a piece of code to a single action command?
darren_13
Member, Developers Posts: 119 PRO
This makes sense in my head, to elaborate... If I have a piece of code that is intensive in terms of many iterations etc, I don't want it to run every time I change a variable. Is there a way of holding off until the setup is finalised and then have some kind of way (maybe a button) to activate the intensive part? I thought about using a boolean but then I would have to both activate then deactivate, this could suffice.
Tagged:
0
Comments
Alternatively, if the heavy work is arriving at some numerical solution that's fast to verify but slow to calculate, you could put that output in a hidden variable. Then, an editing logic function can verify that value and recalculate it if necessary, ensuring the slow work is only done when the value needs to change. Naturally, this may or may not apply to your situation.