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.
How would I go about getting the name of the feature that created a mate connector?
billyzelsnack
Member Posts: 87 PRO
PropertyType.NAME for a mate connector returns "Not set"
https://cad.onshape.com/documents/8d7b305cd6cc7ac723ef683c/v/15c08b8954b5d295f420e143/e/c0de2cb8232e6456778bfb66
https://cad.onshape.com/documents/8d7b305cd6cc7ac723ef683c/v/15c08b8954b5d295f420e143/e/c0de2cb8232e6456778bfb66
0
Answers
otherwise you could give it a generic name instead
var name = "Mate connector " ~ i; i = i+1;
https://cad.onshape.com/documents/3ebe34019ec26d501a678e86/v/1e7ab031a42c9af70e6c195c/e/e40ab2b7c68be32f51191c7a
Now fingers crossed that passing a ui definition query into an attribute is not a big no-no. It appears to work though.
You can use
lastModifyingOperationId(context, query)
, then feed it into aresize(arr, 1)
call to get the top level id.You can then call
getFeatureName(context, featureId)
to get the feature name (it is not listed in the FsDoc library. The link attached to it jumps to its definition in Onshape's FS Library. Additionally, it does not do any replacement parameters)IR for AS/NZS 1100