Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:

  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

Faulty parameter issue in featurescript

darren_13darren_13 Member, Developers Posts: 117 PRO
I have a parameter that I select a plane:

annotation { "Name" : "Select Plane", "Filter" : EntityType.FACE, "MaxNumberOfPicks" : 1 }
definition.selectPlane is Query;

And if there is no selection I want it highlighted in the GUI:

if (size(evaluateQuery(context, definition.selectPlane)) < 1)
        {
            throw regenError("Please select a plane", ["selectPlane"]);
        }

This works for the message but doesn't highlight the parameter? What am I doing wrong?

Thanks in advance,
Darren

Comments

  • darren_13darren_13 Member, Developers Posts: 117 PRO
    Sorry link:

    https://cad.onshape.com/documents/95877be3b17f49277e87a2c3/w/b503830fd20472014beb1221/e/6a7730b786a3030938febbe7

    under 'list exploration' folder, document 'Profile Generator (New)'
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 449
    You're doing everything right, and in fact the error is showing.

    The dialog, however, doesn't show query list in red until the user has moved their selection to another query list. The idea here is, before you're done selecting, you haven't done anything wrong yet, so seeing red immediately is a bit jarring and might confuse someone who was otherwise going to select things correctly. If the user moves on without selecting a plane, then they'll see the parameter in red.

    The feature as a whole errors out immediately, so they'll get a tooltip with your error message when hovering on the feature name (in either the feature list or the dialog), and they'll be prevented from committing a new feature until they fix the error.

    Let me know if you have more questions!
  • owen_sparksowen_sparks Member, Developers Posts: 2,387 PRO
    edited May 2017
    ...The idea here is, before you're done selecting, you haven't done anything wrong yet, so seeing red immediately is a bit jarring and might confuse someone who was otherwise going to select things correctly. If the user moves on without selecting a plane, then they'll see the parameter in red.
    Hi.  Forgive me butting in, but this is something I take a small issue with. 

    Let's just say OS is very "polite" to the user.  I've often missed inputs as the default empty "waiting for an input" field is a happy looking light blue with text in it that blends in to the surroundings.

    By contrast the stuff I write is far more "shouty" to the user.  I tell users that the aim is to make all the red boxes go away before hitting continue.

    Perhaps there is a happy medium of say very light orange for "not wrong, but yet to be filled in fields"? Seems to fall into the accepted convention of red is error, orange is warning and green is good.

    I think I saw an IR for left justifying default tip-text such as "select mate connector" and right justifying actual selections so I believe I'm not alone in this feeling.

    Owen S
    Production Engineer
    HWM-Water Ltd
  • darren_13darren_13 Member, Developers Posts: 117 PRO
    ah cheers @kevin_o_toole_1, I couldn't work out why I was getting the message but not the red box. And I agree with @owen_sparks, yes in terms of using it, I would like big red boxes if I haven't defined the correct things... I spent quite a lot of time debugging once for the simple reason I accidently re-clicked a plane!! A nice red box would have been handy then.

    Kind regards,
    Darren
Sign In or Register to comment.