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.

"Round to the value" option in Variable feature

konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
edited December 2018 in Product Feedback
When using expressions for part studio varible definition you often want a rounded value but all you can now is to use roundToPrecision() function from standart library. It is not only too long to type in a small text field of variable feature, but also it has no overloads for values with units. Parametric capabilities given by variables are significantly reduced by not having a direct way to get rounded value. So please add a checkbox "Round to the value" and an input field with the value to round up to. The formula should be universal for values with units and unitless, and shouldn't depend on units itself - for example value = round(value/roundStep)*roundStep, and should post process any result of expression, assigned to variable if "Round to the value" checked.

Tagged:

Comments

  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,050 ✭✭✭✭✭
    can you use round(value, roundStep); ?
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    @mbartlett21 I could, but it is not documented, it has no overloads for values with units, and it still consumes the area of input field, so I'm for GUI option. I would even want to see this round functionality in any numeric input field but it would requare to implement something like NX measuring tool, which could be called for any numeric input field, just like create selection utility for query fields.
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,050 ✭✭✭✭✭
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    @mbartlett21 I'm sorry then, was searching it near the round() with one argument, and it also handles values with units, so it suits me. But I'm still for GUI option)
  • lougallolougallo Member, Moderator, Onshape Employees, Developers, csevp Posts: 2,005
    @konstantin_shiriazdanov Are you looking for how to round directly in expressions or are you wanting something different.  In FS we have the round that @mbartlett21 mentioned and we also have round in expressions.
    Lou Gallo / PD/UX - Support - Community / Onshape, Inc.
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    @lougallo I'm about to have a checkbox in Variable feature to round result of inserted expression up to user defined round step. Now I find how do round expression in FS but I would like to avoid typind additional text in the single non resizable input field.
  • lougallolougallo Member, Moderator, Onshape Employees, Developers, csevp Posts: 2,005
    @konstantin_shiriazdanov the single non resizable input field is something we will fix.
    Lou Gallo / PD/UX - Support - Community / Onshape, Inc.
Sign In or Register to comment.