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.

Allowing for mate connector selection. What's the correct syntax?

ry_gb
ry_gb Member, csevp, pcbaevp Posts: 273 PRO
edited December 2025 in FeatureScript

I'm testing out different query types and wanted to allow for users to select a Mate Connector. However, when I wrote out:
Filter" : EntityType.BODY && (…|| BodyType.MATE_CONNECTOR),
the feature dialog doesn't allow for mate connector selection or show the mate connector symbol until I add
|| AllowMeshGeometry.NO
as well. Doesn't make a ton of sense to me. Is there anything different I need to do?

Ramon Yip | glassboard.com

Best Answers

  • Konst_Sh
    Konst_Sh Member Posts: 170 PRO
    Answer ✓

    Just BodyType.MATE_CONNECTOR alone should work, also use "UIHint":UIHint.PREVENT_CREATING_NEW_MATE_CONNECTOR if you only want explicit mc's to be allowed

    CADSharp - Onshape custom programming services + Onshape mechanical design services

  • Matt_Shields
    Matt_Shields Member, Onshape Employees Posts: 1,000 PRO
    Answer ✓

    This works for me:

    annotation { "Name" : "Center", "Filter" : EntityType.VERTEX || BodyType.MATE_CONNECTOR, "MaxNumberOfPicks" : 1 }
    definition.centerPoint is Query;

  • MichaelPascoe
    MichaelPascoe Member Posts: 2,959 PRO
    edited December 2025 Answer ✓

    Here is a related post that may be useful for you: https://forum.onshape.com/discussion/15736/implicit-mate-connectors-act-differently-than-explicit-ones…

    And here is a quick way to get the implicit mate connector button to appear, just ensure there are multiple body options (not just one body filter option) and that MATE_CONNECTOR is one of them:

    annotation { "Name" : "myMate", "Filter" : BodyType.MATE_CONNECTOR || BodyType.MATE_CONNECTOR }
    definition.myMate is Query;
    
    image.png

    RENDERCAD - Photorealistic product rendering.
    CADSharp - Professional CAD + software consulting.

    ▚▞▚▞▚▞▚▞▚

Answers