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.

Weird Extra Mate Connectors Added by addInstance()

orion_deyoeorion_deyoe Member Posts: 7 EDU

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

  • orion_deyoeorion_deyoe Member Posts: 7 EDU

    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:

    https://cad.onshape.com/documents/51b9d0196fd7beaee78ad90b/w/6045f9b95ae1cc9fb85c8a40/e/d8dd8291d7858d415c6f2ff9

    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.

Sign In or Register to comment.