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.

How to strip the units from a length?

jackson_kingjackson_king OS Professional Posts: 80 PRO
Hi All,
Is there a way to strip a length of it's units so the decimal number can be used in a "ceil(#/#)" equation?

I am trying to use configs to create an expanded metal/grating generation part studio and have it working well except for getting the desired sheet size to auto size.  I am using measure distance FS to get the lengths and widths for the distance of the pattern and am trying to use that measure distance number in the ceil function to drive the instance count. In this case, ceil(#Desired_Length/#Length) or ceil(#Desired_Width/#Width).

Here's the document:

Thanks in advance!

Best Answers


  • jackson_kingjackson_king OS Professional Posts: 80 PRO
    Thanks @Jake_Rosenfeld!  I was testing things before submitting the question and never had it as a #variable/#variable, just a number/#variable.  What you said makes perfect sense and it works!
  • jackson_kingjackson_king OS Professional Posts: 80 PRO
    @Jake_Rosenfeld, is there a way to remove the units if I needed too? 
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,005 ✭✭✭✭✭
    value with units has internal structure of map type, so #length.value should give a unitless number
  • jackson_kingjackson_king OS Professional Posts: 80 PRO
    Thanks guys! It all works well now. I think my next attempt should be turning this thing into featurescript. Which should be interesting as featurescript and I don’t see eye to eye on things sometimes. 
Sign In or Register to comment.