How would I go about getting the name of the feature that created a mate connector?
billyzelsnack
Member Posts: 96 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
-
I don't think there is a way to know what feature created it outside of the same featurescript. (I could be wrong)
otherwise you could give it a generic name instead
var name = "Mate connector " ~ i; i = i+1;
2 -
I am using the table data in an external program so the feature id is probably good enough and it is probably better to be guaranteed unique anyway.
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.
0 -
@billyzelsnack
You can uselastModifyingOperationId(context, query), then feed it into aresize(arr, 1)call to get the top level id.
You can then callgetFeatureName(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)2 -

0

