Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
mates showing in part studio not present when in assembly
I am exploring and learning about both derive and featurescript here. In each of the part studios base_unit
and insert_unit
I create a mate connector. I use my featurescript with an instantiator to create a configurable grid of those in other part studios base
and bin
respectively. There I can see all the desired mate connectors.
They are not visible in the assembly.
- Is there a modeling approach to getting these to pass through? My impression is that they are owned by the part in the 'sub-part-studio' where they are created (such as
base_unit
) and thus when I assemblebase
itself they are not made available in the assembly. - I have attempted to add to my featurescript an ability to query all the mates that were created in the instantiation of the grid. The plan was to then create new properly owned mate connectors that would end up present and usable in an assembly. But… I haven't yet gotten the code to get me an actual mate object that I could then 'duplicate' or set ownership of (if that's even a thing) etc.
for (var name, query in instanceQueriesByName) { debug(context, "name: " ~ name); debug(context, "query: " ~ query); var featureId = query["featureId"]; debug(context, "feature id: " ~ featureId); var mate_query = qMateConnectorsOfParts(qCreatedBy(featureId)); debug(context, "is mate query empty: " ~ isQueryEmpty(context, mate_query)); debug(context, "a: " ~ evaluateQuery(context, mate_query)); for (var q in evaluateQuery(context, mate_query)) { debug(context, " a: " ~ q); debug(context, " a: " ~ evaluateQuery(context, q)); } for (var thing in evaluateQuery(context, mate_query)) { debug(context, "thing:" ~ thing); } }
debug: name: 0x0y debug: query: Query : { "entityType" : EntityType : "BODY" , "featureId" : Id : [ "FMmzkb7PtMYvtKx_1" , "instantiator" , "Auto0" ] , "queryType" : QueryType : "CREATED_BY" } debug: feature id: Id : [ "FMmzkb7PtMYvtKx_1" , "instantiator" , "Auto0" ] debug: is mate query empty: true debug: a: []
I am interested in learning so would be happy for help in either or both paths to addressing the high level goal. Or some other path too…
Thanks.
Cheers,
-kyle
Comments
I eventually managed to get the query, creation, and ownership correct.
https://cad.onshape.com/documents/31d9f3436d1f6286f056967a/v/17cfe86a0094f9ee674dbd9b/e/fd67035c9e5e62f496ede719