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.

Questions about units

ron_morelandron_moreland Member Posts: 90 ✭✭
I've more or less finished my first real feature script. Thanks for all the help! I had excellent help from the forum. I have questions about values with units.

I think everything in the database has meters as the length unit. Other units are assigned as conversions from meters. When I print values via "debug()", the values are in meters. Can I convert them at print time to inches?

How do you change numbers to values with units and back?
Tagged:

Best Answer

Answers

  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited January 2018
    println(length/inch~" inches") if you are sure that length variable contains the value with units of length type
  • ron_morelandron_moreland Member Posts: 90 ✭✭
    Sometimes "Foo * inch" will convert the value to an area. Why?
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Sometimes "Foo * inch" will convert the value to an area. Why?
    Presumably in this case your foo already had units, so units squared = area?

    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
Sign In or Register to comment.