How to extract/get two adjacent node numbers/Ids near the centroid of a circular face through API?
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
-
Hello Stacky!
Please check this link:
https://discuss.ansys.com/discussion/2839/how-to-get-a-body-or-node-id-associated-with-a-known-coordinate-point-location
To obtain the coordinates of the center of the surface:faceId = 35 geofaceWrapper = ExtAPI.DataModel.GeoData.GeoEntityById(faceId) faceCenter = geofaceWrapper.Centroid
If there are few nodes on the surface, the adjacent nodes can be found by simple iteration over all the surface nodes. For a large number of nodes (>100,000), a KDTree can be used.
Can you provide more context? Perhaps an image?1