Can I set a Feature UI preview tolerance with Featurescript?

EvanReese
EvanReese Member, Mentor Posts: 3,100 PRO
I'm working on a feature that uses refractive indexes of various materials, and one of them defaults to 1.00027717 (which is air), instead of 1 (which is a vacuum). When you just look at the feature UI though, all of it is rounded to 1 until you click the field to edit it, so a user wouldn't understand what the default number actually is. Is there a way I can control how many decimal places to preview?
Evan Reese
The Onsherpa | Reach peak Onshape productivity
www.theonsherpa.com

Answers

  • glen_dewsbury
    glen_dewsbury Member Posts: 1,382 PRO
    The only way I know of is the work space units and changing decimal places there. Can you temporarily change the work space properties while in your function?
  • _anton
    _anton Member, Onshape Employees Posts: 555 image
    Crude workaround, but you could use a string parameter, which will display your value literally, and use stringToNumber in FS.
  • EvanReese
    EvanReese Member, Mentor Posts: 3,100 PRO
    Thanks for the ideas. Either of those are even less desirable, so I'll roll with it as-is, but very much appreciate the input 
    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • NeilCooke
    NeilCooke Moderator, Onshape Employees Posts: 6,126 image
    Perhaps you could display an info banner with the actual number with a description?
    Senior Director, Technical Services, EMEA