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.

Select a sketch from another studio?

MichaelPascoeMichaelPascoe Member Posts: 2,827 PRO
edited April 2021 in FeatureScript
I'm trying to select a sketch from another studio. I can get close, but I'm missing a few steps. What is a good way to do this?
https://cad.onshape.com/documents/76442daf92ce43df74883ec6/w/2f4ea4d52c5fb26051e11c55/e/cdac35e0ee54c70d46280df1

Also, if there is a way to select a mate connector from another studio, that would be helpful too.

Here is the precondition:
annotation { "Name" : "Profile to sweep" }
            definition.otherStudioProfile is PartStudioData;
 When I debug the selection here are the results:
debug: PartStudioData : { "buildFunction" : <function 12> , "configuration" : {} , "partQuery" : Query : { "queryType" : QueryType : "UNION" , "subqueries" : [ Query : { "entityType" : EntityType : "BODY" , "featureId" : Id : [ "FzKsf89ZtRsirEg_0" ] , "queryType" : QueryType : "CREATED_BY" } ] } }

RENDERCAD
rendercad.ai - Photorealistic product rendering.

▚▞▚▞▚▞▚▞▚
________________________________________________________________________

Best Answer

  • Alex_KempenAlex_Kempen Member Posts: 258 EDU
    Answer ✓
    Instantiator can take PartStudioData as an argument directly. You can also optionally filter the partQuery to remove unnecessary information, if you wish - for more information, see this part of the documentation. There isn't any way to bring in mate connectors directly, but you can bring them in by importing the body they're attached to. You could also try doing shenanigans with evBox3d to determine the center of imported profiles and orient things appropriately that way too.
    Software Developer at Epic Systems
    FRC Design Mentor - Team 1306 BadgerBots


Answers

  • Alex_KempenAlex_Kempen Member Posts: 258 EDU
    Answer ✓
    Instantiator can take PartStudioData as an argument directly. You can also optionally filter the partQuery to remove unnecessary information, if you wish - for more information, see this part of the documentation. There isn't any way to bring in mate connectors directly, but you can bring them in by importing the body they're attached to. You could also try doing shenanigans with evBox3d to determine the center of imported profiles and orient things appropriately that way too.
    Software Developer at Epic Systems
    FRC Design Mentor - Team 1306 BadgerBots


  • MichaelPascoeMichaelPascoe Member Posts: 2,827 PRO
    Thanks @Alex_Kempen

    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
  • MichaelPascoeMichaelPascoe Member Posts: 2,827 PRO
    @Alex_Kempen, I referenced you in my Pattern & sweep feature on the instructions tab:
    https://forum.onshape.com/discussion/15560/pattern-sweep-new-custom-feature#latest

    RENDERCAD
    rendercad.ai - Photorealistic product rendering.

    ▚▞▚▞▚▞▚▞▚
    ________________________________________________________________________
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.