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.

Options

Why importing from other onshape docs convert from mm to inches?

pieri70pieri70 Member Posts: 10 ✭✭
edited June 2016 in Using Onshape
Hello
I'm beginning to use OS
I was attempting to copy a public document and then make some mods.
Until today all went fine.
Then I cancelled by mistake a piece and  tried to copy another one from a public document.

My problem is that when I copy the part studio to clipbord an then paste in My document by import function, the part studio is converted to inches...
In my preferences I set mm/deg/gram under preferences.
If I examine the code of my previous parts I can see:

*******************************
FeatureScript 370;
import(path : "onshape/std/geometry.fs", version : "370.0");

annotation { "Default Units" : ["degree", "millimeter", "pound"] }
export function main()
{
    return build();
}

export function build()
{
    const context is Context = newContextWithDefaults(millimeter);
**************************




The part to import code is:

***************************
FeatureScript 370;
import(path : "onshape/std/geometry.fs", version : "370.0");

annotation { "Default Units" : ["degree", "millimeter", "pound"] }
export function main()
{
    return build();
}

export function build()
{
    const context is Context = newContextWithDefaults(millimeter);
    const id is Id = newId();
*****************


Once I import it the code changes to:
********************
FeatureScript 370;
import(path : "onshape/std/geometry.fs", version : "370.0");

annotation { "Default Units" : ["degree", "inch", "pound"] }
export function main()
{
    return build();
}

export function build()
{
    const context is Context = newContextWithDefaults(inch);
************************

Why?????

Then
My document was 80MB, I eliminate almost everything unnecessary and it is as big as it was.
As I eliminate things the dimension rises...
Why???

Thanks
Pietro

Comments

  • Options
    pieri70pieri70 Member Posts: 10 ✭✭
    Ok, got it
    it was the document units...

    But I'm almost sure I didn't change them...

  • Options
    ethanethan Member, Onshape Employees Posts: 24
    Document units are default inches. Each new document must be changed. Or you can change the default units in your account settings. 
  • Options
    pieri70pieri70 Member Posts: 10 ✭✭
    edited July 2016
    Yes I realized this..
    But my document was a private copy of a document found in Onshape, and it was originally in millimeters...
    And I was making mods in millimeters for a period..

    Then at some point OS decided, by itself,  that some pieces imported were in inches..
    And all new Part Studios had to be in inches..

    For the dimension problem..
    I copied/pasted all pieces in a new document and magically the new document went from 80MB to 12MB.

Sign In or Register to comment.