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.
Feature Request: help text in feature UI
a short description of each choice ( sometimes), and help text.
I've also been unable to figure out how to display a friendly message to a user when there is a problem.
Combined, this makes usability poor.
Suppose, for the sake of argument, that i have the user selecting two planes, and they cannot be perpendicular.
(1) i have no way to tell the user "these planes must not be perpendicular" in the UI.
(2) the best i can do is
throw regenError ( ErrorNumber.INVALID_INPUT, [ definition.choice1, definition.choice2] );
which does highlight the choices, but doesn't tell the user what actually was wrong.
(3) there is no way in the preconditions to check that they are not perpendicular, so to make matters worse, unless the user happens to have the featurescript debug window open, the user will dismiss the box before realizing it is broken.
I think there should be solutions to all three of these. an overloaded signature for regenError with a message that displays in the UI, an annotation on the user inputs that allows setting a short description, and a single annotation somewhere on the feature itself that gives a block comment or help page. ( I think since this is large, it would ideally be displayed in a help bubble on request by the user ).
The inability to test complex conditions in the preconditions might be too difficult to change, since that's kind of baked in at the language level.
Answers
On the UI side of things: When throwing a regen error, as you've done, the feature itself will be highlighted in red, and the specific error (i.e. the text for that specific ErrorStringEnum value) will be shown in the tooltip if the user hovers over the feature. Not terrible, but also not very discoverable.
However, we also have another error reporting mechanism, which is designed for errors in a top level feature, of the form "Hey, this probably means you should just adjust your inputs":
ReportFeatureInfo() will pop up a message bubble every time the user changes the feature definition such that the error is newly triggered, or whenever the user opens the feature dialog while the error is present.
You can also simply println() more info with any string you want, but the downside of that is that anything reported with println() isn't as immediately visible to the end user as the native Onshape errors are.
So i just need ability to add my own ErrorStringEnums...