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.

Can more than 1 import be put into the same part studio? If so, how is this done?

alwyn_limalwyn_lim Member Posts: 57 ✭✭
Can more than 1 import be put into the same part studio? If so, how is this done?

Best Answers

  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    Answer ✓
    I've wondered the same thing before and your post got me curious so I did some digging, and found that there's an FS function for it so I wrote a feature for it between meetings. It's a lot faster than deriving the same thing. too. https://cad.onshape.com/documents/61cc8612f166ab2d49db4e3a/v/bb7dda147bbbebd5f32f5df9/e/3230f795252a09ff6486a466



    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    Answer ✓
    I don't think there's a way right now. I know that when adding an image or dxf to a sketch there's a button at the bottom that does that (see screenshot), but I don't think it's possible for me to add it with FeatureScript. I'd love to be wrong though. Anybody know a way?

    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io

Answers

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,308
    Hi @alwyn_lim - use the Derived feature to bring in as many imports (or other models) as you like.
    Senior Director, Technical Services, EMEAI
  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    Answer ✓
    I've wondered the same thing before and your post got me curious so I did some digging, and found that there's an FS function for it so I wrote a feature for it between meetings. It's a lot faster than deriving the same thing. too. https://cad.onshape.com/documents/61cc8612f166ab2d49db4e3a/v/bb7dda147bbbebd5f32f5df9/e/3230f795252a09ff6486a466



    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • MichaelPascoeMichaelPascoe Member Posts: 1,694 PRO
    @Evan_Reese

    Another feature

    Me:
     

    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    @MichaelPascoe
    lol. I literally just went "show code" on a studio that had an import, to see what function was used, then made a wrapper for it with FS. It's almost no code at all:
    FeatureScript 1746;
    import(path : "onshape/std/geometry.fs", version : "1746.0");
    
    annotation { "Feature Type Name" : "Import 3D File" }
    export const importFeature = defineFeature(function(context is Context, id is Id, definition is map)
        precondition
        {
            annotation { "Name" : "3D File" }
            definition.file is CADImportData;
        }
        {
            opImportForeign(context, id + "importForeign1", {
                    "blobData" : definition.file
            });
        });

    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • alwyn_limalwyn_lim Member Posts: 57 ✭✭
    @Evan_Reese Wow, thanks! ..... Added your custom feature into my toolbar and was able to insert multiple pre-imported 3D into a part studio.

    Was wondering whether it's possible use your custom feature to directly select a 3D (eg STP,/STL on my local hard drive) that has yet to be uploaded to Onshape (ie already in another part studio)?....... Hope this becomes standard in Onshape soon.
  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    Answer ✓
    I don't think there's a way right now. I know that when adding an image or dxf to a sketch there's a button at the bottom that does that (see screenshot), but I don't think it's possible for me to add it with FeatureScript. I'd love to be wrong though. Anybody know a way?

    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • alwyn_limalwyn_lim Member Posts: 57 ✭✭
    @Evan_Reese Could you please add an option to directly position the imports (without having to do subsequent Transforms) in a Part Studio (eg: placed at a Mate Connector where the import part Origin is)?
    Use case: when trying to superimpose parts, but scan file Origin is different from externally modelled 3D file Origin..... Have just posted an improvement request on this too, but no telling if and how long this will take to be built into OS.

  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    I can, but I suppose I don't see the value. All I can think to do it essentially add the "Transform by mate connector" UI to this feature, but that Transform feature is a click away, so why bother? I try to avoid clumping features together that could be easily created by a chain of features, which is what CAD is all about. Is there a use-case you have in mind that this is a pain for?
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
  • alwyn_limalwyn_lim Member Posts: 57 ✭✭
    @Evan_Reese you are right; it's just 1 more feature..... just thought it's cleaner to import directly into the correct position.
  • Evan_ReeseEvan_Reese Member Posts: 2,060 PRO
    Got it. That makes total sense. I often made the mistake early in my FeatureScripting of trying to pack too much into a single feature, and have been trying to simplify a bit. Keeping unrelated functionality in separate features actually makes them more widely applicable since they can be combined in more ways. That's my take on it anyway.
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
Sign In or Register to comment.