Identify mating faces using NXOpen API ?
Identify mating faces using NXOpen API ?
(OP)
Hello Everyone,
I have some applications which require identification of mating faces between 2 components in an assembly. There are no assembly constraints used for the assembly. These 2 components are simple touching. I wanted to know if someone in the group is aware of some NX API that can determine mating faces quickly.
We are currently employing a strategy, where-in we loop through all the solid bodies and get its faces. Then we compare each face in one component with the other component, measure the distance, compare the face normals and then determine mating.
I also wanted to check if we can employ some form of NX based rules to do this task.
Please let me know if someone has a better approach to my problem.
Cheers,
Amitabh
I have some applications which require identification of mating faces between 2 components in an assembly. There are no assembly constraints used for the assembly. These 2 components are simple touching. I wanted to know if someone in the group is aware of some NX API that can determine mating faces quickly.
We are currently employing a strategy, where-in we loop through all the solid bodies and get its faces. Then we compare each face in one component with the other component, measure the distance, compare the face normals and then determine mating.
I also wanted to check if we can employ some form of NX based rules to do this task.
Please let me know if someone has a better approach to my problem.
Cheers,
Amitabh





RE: Identify mating faces using NXOpen API ?
Consider adding filtering along your loops, here are some ideas, i'm not sure they are valid for your case:
1. Iterate only Solid bodies
2. Iterate only Planar faces
just in-case your application is a dll attached to NX session consider replacing it with exe, you'll get better performance.
RE: Identify mating faces using NXOpen API ?
Thank You,
Amitabh
RE: Identify mating faces using NXOpen API ?
www.nxjournaling.com
RE: Identify mating faces using NXOpen API ?
Thank You,
Amitabh
RE: Identify mating faces using NXOpen API ?
I've never used it, but the .TraceARay method might work for this. The .AskMinimumDist method returns 2 points, you could use these 2 points to calculate a vector and use the vector in the .TraceARay method; it should return the faces that are hit. Alternatively, you could iterate through the faces on the body and use the .AskPointContainment function to see which face contains the point.
www.nxjournaling.com
RE: Identify mating faces using NXOpen API ?
RE: Identify mating faces using NXOpen API ?
Thank You,
Amitabh