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.

Set UI list default from enum

graham_lockgraham_lock Member Posts: 173 PRO

Hi,

I have the following:

export enum EXTRUDE_TYPES
{
annotation { "Name" : "Loft" }
EXTRUDE_TYPES_LOFT,
annotation { "Name" : "Sweep" }
EXTRUDE_TYPES_SWEEP,
}

annotation { "Name" : "Loft or Sweep", "Default" : EXTRUDE_TYPES.EXTRUDE_TYPES_SWEEP}
definition.extrudeType is EXTRUDE_TYPES;

I've tried various combinations but I cannot seem to make the list UI default to sweep?

Any help appreciated.

Thank you.

Comments

  • Jed_YeiserJed_Yeiser Member Posts: 45 PRO

    This appears to be correct. Are there other errors that are showing up that might be preventing the UI from displaying correctly? Are you updating this parameter using editing logic? Are you sure that it's not defaulting correctly? As embarrassing as this is to admit, I've run into similar issues only to realize that I added a default after a certain parameter had been created and set - so it stayed as I'd set it rather than displaying the default value. If that's the case, just delete your feature and create a new one - the new feature will have correct defaults.

  • graham_lockgraham_lock Member Posts: 173 PRO

    Thanks Yed.

    I deleted the feature and then recreated it as you suggested and it works!

Sign In or Register to comment.