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: 35
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: 1,293 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: 1,293 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: 4,163
    Hi @alwyn_lim - use the Derived feature to bring in as many imports (or other models) as you like.
    Director, Technical Services, EMEAI
  • Evan_ReeseEvan_Reese Member Posts: 1,293 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: 768 PRO
    @Evan_Reese

    Another feature

    Me:
     
  • Evan_ReeseEvan_Reese Member Posts: 1,293 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: 35
    @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: 1,293 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
Sign In or Register to comment.