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

Select a sketch from another studio?

MichaelPascoeMichaelPascoe Member Posts: 1,713 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" } ] } }

Learn more about the Gospel of Christ  ( Here )

CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎

Best Answer

  • Options
    Alex_KempenAlex_Kempen Member Posts: 244 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.
    CS Student at UT Dallas
    Alex.Kempen@utdallas.edu
    Check out my FeatureScripts here:



Answers

Sign In or Register to comment.