Weird Extra Mate Connectors Added by addInstance()
I have a featurescript that inserts a part from a configurable part studio at a specific mate connector. The feature brings along any mate connectors in the part studio as well. I'm using an instantiator with a partQuery specified. Like this:
const instantiator = newInstantiator(id + "blockBody", {"partQuery" : qBodyType(qEverything(), [BodyType.SOLID, BodyType.MATE_CONNECTOR])});
In my configurable part studio I happen to use the Transform feature with a "From Mate Connector" and "To Mate Connector" to reposition a body. These mate connectors are implicit (just selected from edges on the part in the part studio).
When I use the featurescript, the two mate connectors selected in this transform feature come with the part along with the mate connectors created explicitly in the part studio even though they don't actually exist. They don't show up when you show/hide mate connectors but they come over with the instantiator.
How do I exclude these? I've tried using qOwnedBy(qAllSolidBodies()) but it seems my explicit mate connectors get filtered out by this as well and with the configurability of the part this isn't possible to fix as far as I see.
Answers
-
What I have done for now is create explicit mate connectors to perform the transform operations and then use a separate custom featurescript to delete those mate connectors. Here is that featurescript if anyone wants it:
It works, but it's hacky and blows up the feature count. Also, deleting mate connectors feels like it should be a thing that "delete part" or a similar feature should already do.
0 -
I'm running into this on something. Anyone have a cleaner solution that doesn't involve changing the setup on the source studio?
0 -
Ended up filtering with qMateConnectorsOfParts() since the implicit ones don't have an owner body.
0
