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.

evCollision Clashtypes?

Chris_D_Mentes_001Chris_D_Mentes_001 Member, csevp Posts: 102 PRO
Okay so I'm playing around with the evCollision command but it seems odd to me that there is 8 "clashType" enum values but no matter how I arrange my tool and target bodies I can't seem to get all 8 outputs. So far I've figured out how to get: INTERFERE, ABUT_NO_CLASS, TOOL_IN_TARGET and TARGET_IN_TOOL. For some reason rather then returning a map with clashType NONE it just returns an error when there's no collisions. Even if there is just one vertex shared between two bodies the clashtype is still ABUT_NO_CLASS rather then EXISTS. And I understand what ABUT_TOOL_IN/OUT_TARGET in theory but in practice I can't seem to replicate that result (I assume one body is completely enclosed by the other but they share a face, line or vertex?). Can anyone tell me what I'm doing wrong here?

Also I can use the results of the evCollision Array maps when it comes to the .tool .toolBody .target and .targetBody but .type returns an error. I assume this is because type is a reserved word but why use it as a feild name then? also ."type" doesn't work nor does .(type) . To print the collision type to console I had to print the entire array entry.

https://cad.onshape.com/documents/c8eef2271809c4293325c9b1/w/d82cceae829e190d1649e512/e/e0f1b2c585964eae1de0629c?renderMode=0&uiState=63b52900cbacbd58b9943d51
Link share with onshape support enabled.
Tagged:

Best Answer

Answers

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,671
    I can't comment about the clash types, I just roll with what result it gives, but the type is done like this:
    if (clash["type"] == ClashType.ABUT_NO_CLASS)
    Senior Director, Technical Services, EMEAI
  • Chris_D_Mentes_001Chris_D_Mentes_001 Member, csevp Posts: 102 PRO
    Thanks @NeilCooke That solves that! I'll still mark this post as unanswered to figure out the clashType enums but that does help with the reference to the 'type' feild. Didn't know you could refer to a map feild using a sort of array like notation map["feild"]. Is there any documentation that explains this further?
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,671
    Answer ✓
    https://cad.onshape.com/FsDoc/type-tags.html

    It provides a lot of flexibility creating/evaluating key/value pairs using strings.
    Senior Director, Technical Services, EMEAI
  • Chris_D_Mentes_001Chris_D_Mentes_001 Member, csevp Posts: 102 PRO
    @NeilCooke you bloody legend mate!
Sign In or Register to comment.