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.
query input validation
adamohern
Member, OS Professional Posts: 216 PRO
Is there a way to reject a query selection based on arbitrary criteria? For example, what if I wanted to accept a face as an input, but I wanted to reject any face that lacks at least one linear edge? What if I wanted to only accept circular faces, blue faces, or faces whose Normal points 37 degrees North?
Tagged:
0
Comments
Probably the way to handle such requirements is allow selection of a broader set of things, and call reportFeatureInfo() to pop up a message letting the user know that their face didn't have a linear edge or whatnot.
Right now, reportFeatureInfo() only allows an enum full of errors written for Onshape features (this was done for security and translatability), but you'll be able to pass in any string you want in the very near future. println() is an okay stand-in for the short interum.