How to extract/get two adjacent node numbers/Ids near the centroid of a circular face through API?

Stacky
Stacky Member Posts: 3
Name Dropper First Comment
**

Hi,
I need to impose displacement boundary conditions on two adjacent nodes near the centroid of a circular face of a composite geometry. In this regard, I need to know the two adjacent node Ids. Note that element spacing on the face is kept at 0.2 mm. I was able to extract the node Ids on the face; but, don't know how to get the two adjacent node Ids near the centroid of the face using API in Ansys Workbench Shell.

Best Answer

Answers

  • Stacky
    Stacky Member Posts: 3
    Name Dropper First Comment
    **

    Thank you @AlexGh for your help. I was able to sort it out with your tip. I wrote the following:

            for node in nodes:
                cx=node.X
                cy=node.Y
                cz=node.Z
                distc=sqrt((bx-cx)**2+(by-cy)**2+(bz-cz)**2)
                if distc<dist:
                    myn=node.Id
            sidn.Ids=[myn, myn+1]
            dnbc.Location=sidn