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.
set default value for length and angle in annotation in feature script precondition
daniel_cravens
Member Posts: 29 ✭
How do you set a custom default value in a length and angle precondition? I'd like the default length to be 10 mm and the default angle to be 65 degrees.
0
Comments
1. You can set default boolean and default string values like this: annotation { "Name" : "myBool", "Default" : false}
2. However, if you want to set other numbers, degrees, etc you need to use editing logic as in the below. ***
*** This statement is incorrect. Defaults for numbers and degrees are possible as explained by NeilCooke below. The editing logic method works but is overkill for basic default values.
This code sets the default values upon UI open and for the first dovetail joint. It then sets the default for each subsequent joint based on the settings for the first joint. Also this is an example of how to implement an array variable in the precondition.
Caveat: this works but is certainly not the most efficient implementation as I am merely a hobbiest.
****
// set default for each new joint to the values set for the prior joint