Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

Selecting Outer Faces Using Ansys Discovery ScriptEditor

    • to.81
      Subscriber

      I have two parts where one is encapsulated by the other(imagine a layered shape, or like an onion). I want to select all the outer faces of the inside part and all the inner faces of the outside part in order to create a bonded contact. None of the faces of either parts share anything in common so I can't use the power selection tool. I've tried creating a bonded contact that is just Component1.ConvertToFaces and Component2.ConvertToFaces, but the contacts don't turn out the way that it should be if I had manually selected each component and created a bonded contact. Additionally, there are some faces that aren't touching the other parts at all and I don't want those in my selection. I just want to select the faces that are identical and touching between the inside and outside parts.

    • mohan.urs
      Ansys Employee

      Hey,
      I don't think there is a direct approach to do this - You can try this - loop over faces of both parts, filter by proximity using face centroids MeasureHelper.GetCentroid(face), then verify face opposition using face normals (face.GetFaceNormal(u,v) and a dot-product check). For accurate gap checks, use MeasureHelper.DistanceBetweenObjects (or centroid distance as a lightweight prefilter). Faces that pass distance tolerance + opposite normal criteria are collected and grouped to create contacts. For suitable examples for these commands, you can search through the developer forum - Home - Community Forum

      Regards,
      Mohan Urs

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
[bingo_chatbox]