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.
How do I set the "MaxNumberOfPicks" with a query?
MichaelPascoe
Member Posts: 1,993 PRO
How do i set the max number of picks with a query?
precondition { annotation { "Name" : "Group Size" } isInteger(definition.quantity, POSITIVE_COUNT_BOUNDS); annotation { "Name" : "Parts", "Filter" : EntityType.FACE, "MaxNumberOfPicks" : 1 } definition.parts is Query; }<br>
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Tagged:
0
Answers
Long answer: You could use the editing logic function to force a variable max number of picks. You'll need to decide what happens to the query when you go over the max number of picks; do you delete the last item from the query, or get rid of the first?
Example:
The reason I need to set the "MaxNumberOfPicks", is so that once you fill the query, it will automatically tab you to the next input box.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Thank you Mahir, I will give this a try.
Would this have any relation to a selection-driven array parameter?
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
That could be a decent work around. So I can have a drop down menu with 5 or so different group sizes. Depending on which group size you choose, an almost identical query will be chosen that is set up with a different "MaxNumberOfPicks".
Thanks for the help!
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Here is the feature I used this info to make:
https://forum.onshape.com/discussion/15155/boolean-groups-new-custom-feature#latest
It doesn't auto tab to the next box, but it turned out nice.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴