Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape, CAD, maker project and design.

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.

Unit conversion

derek_boasederek_boase Member Posts: 3 EDU
I made a document under inches and should have used mm. Is there any way I can change the units so where I put, say 10 in it will show up as 10 mm? 

Comments

  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,092
    @derek_boase

    You can control the units for a workspace that has already been created by adjusting the workspace units from the dropdown at the top of the document:


    The units of future documents that you create is controlled by your account settings:

    Jake Rosenfeld - Modeling Team
  • paul_bunnellpaul_bunnell Member Posts: 11 EDU
    The question states that the goal is to have 10 inches turn into 10 mm.  Changing the workspace unit changes 10 in into 254 mm.  Does anyone know how to do the unit substitution instead of unit conversion?
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,092
    @paul_bunnell

    The workspace units only control what unit is attached to the input if you type "10" and press enter.  We wouldn't want changing the workspace units to do a conversion of the entire system, especially because someone could have specifically put "5 cm" and pressed enter somewhere.  What happens to that one when you change all the inches to cm? Does it stay the same while all the others change around it?  Is it scaled like everything else?  This may change the entire shape of your part, not just its size.

    If a part has been designed entirely in the wrong unit system, and a scaling needs to be applied, you could use the transform feature to scale that part by the scale factor between the two unit systems (see "scale uniformly"):
    https://cad.onshape.com/help/Content/transform.htm
    Jake Rosenfeld - Modeling Team
  • brian_bradybrian_brady Member, Developers Posts: 361 EDU
    @paul_bunnell

    The workspace units only control what unit is attached to the input if you type "10" and press enter.  We wouldn't want changing the workspace units to do a conversion of the entire system, especially because someone could have specifically put "5 cm" and pressed enter somewhere.  What happens to that one when you change all the inches to cm? Does it stay the same while all the others change around it?  Is it scaled like everything else?  This may change the entire shape of your part, not just its size.

    If a part has been designed entirely in the wrong unit system, and a scaling needs to be applied, you could use the transform feature to scale that part by the scale factor between the two unit systems (see "scale uniformly"):
    https://cad.onshape.com/help/Content/transform.htm
    We generally don't want changing the units to change the size of our parts. That is correct. However, what about when we do want that? Adding a transform to every part is an ugly solution when that is what you want. Could there not be a "rescale all part studio dimensions" option that asks "are you sure you want to rescale all part studio dimensions? this will take time and cannot be undone."? It fixes the "oh crap, I modeled a bunch of parts in inches but they were supposed to be in mm" errors that pop up once in while if you switch units often.
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 1,757
    @brian_brady - as far as I know, Creo is the only system that can do this. It would be a major undertaking for us to develop such a function that I believe wouldn’t be used that often. Please create an IR and prove me wrong!
    Neil Cooke, Director of Technical Marketing, Onshape Inc.
  • brian_bradybrian_brady Member, Developers Posts: 361 EDU
    The bad part of using a transform is that when editing part features the units will be in the pre-transformed state. I hate it when my students transform a part to change orientation or change position and I double-click on a sketch or feature to inspect it and everything moves to a new location. I am fairly certain I don't like 3D transforms being part of the feature tree. If they were not features, just permanent changes, I would care less about global unit changes.
  • kenn_sebesta167kenn_sebesta167 Member Posts: 3
    Agreed. There should be an option to scale an entire everything by some fixed amount. It'll mean that nice round numbers are no longer so round, but that's the choice the designer makes, right? If the model can be "scaled" to show 1" --> 25.4mm, then it can also be "scaled" to show 1"(old) --> 25.4" (new).

    After all, what we interact with is just a series of line vectors, so in the abstraction they are dimensionless.
  • mbartlett21mbartlett21 Member Posts: 1,141 EDU
    They are actually measured internally in metres and radians.
    MB (I make FeatureScripts: view FS)
  • owen_sparksowen_sparks Member, Developers Posts: 1,823 PRO
    A bit off topic but Fusion has a great way of scaling images.  Click on two points and enter a number. 
    Production Engineer
    HWM-Water Ltd
  • kenn_sebesta167kenn_sebesta167 Member Posts: 3
    @mbartlett21, they're not, though, right? Models are just a representation of the physical world, not the physical world itself. What's in them are pure numbers and angles and equations, and the scale doesn't matter. The relationships and algorithms stay identical whether they are called "meters", "feet", or "OnShapes". And our interaction with them as users is pixels on the screen and then maybe generation of scaled drawings.

    OnShape might have called their internal units meters for familiarity and ease of use, but ultimately it's just bits and data and can be scaled arbitrarily.

    Here in the less abstract world, I ran across this problem when I used an image to create a part. I defined one dimension on the image and traced everything else from there. Unfortunately, my initial dimension was wrong so the entire trace was wrong by a scalar factor. The only solution was to retrace everything. Pain in the butt and a loss of an hour.
  • lemon1324lemon1324 Member, Developers Posts: 152 EDU
    edited November 29
    The larger issue is that Onshape allows you to input things like "1mm * floor( (1in + 5mm - 0.002in)/0.125in )" in order to preserve design intent.  This isn't stored as a dimensionless number that we happen to call meters, it's actually stored as an expression.  I can't think of a great way to scale such a thing without at minimum obscuring the design intent; at that point you'd essentially end up re-dimensioning everything anyways. I don't think scaling the entire document workspace unit is enough of a use case to justify Onshape rewriting relatively low-level data structures.
    That's not to say that image tracing scaling shouldn't be improved, however.  While you can do the sketch scaling trick to adjust the image for tracing (import the image, draw a construction line between two known points, and dimension it as the first thing), that leads to the issue you had; the relevant IR to rescale sketches after the fact is here: https://forum.onshape.com/discussion/8976/sketch-scale, although that would have the same issue of how to scale a dimension that is the result of a user-input expression.



    Arul Suresh
    PhD Candidate at Stanford University
  • kenn_sebesta167kenn_sebesta167 Member Posts: 3
    Huh, I didn't know you could mix dimensions like that in an expression. For sure, that's an excellent point for why a simple, naive change won't be successful in 100% of cases.

    If someone's looking to scale a model it's impossible to autonomously determine whether they'd want to keep that expression as-is or have it scale with the model. If OnShape wanted to implement this feature, it would probably be sane behavior to fail at those points, just like it would if you redimensioned something and it caused the model to become unsolvable.
Sign In or Register to comment.