×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Identify mating faces using NXOpen API ?

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

RE: Identify mating faces using NXOpen API ?

Hello Amitabh,

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 ?

(OP)
Thank you for your suggestion, Tomerl. I forgot to mention that I am already doing both of them in the code to reduce the number of iterations and checks. I am using the following properties .IsSolidBody and .SolidFaceType to achieve this. Any other piece of advice that you would like to give ?

Thank You,
Amitabh

RE: Identify mating faces using NXOpen API ?

I'd start by using one of the .AskMinimumDist methods on the solid bodies. If the distance is greater than your "mating tolerance" distance, then the 2 bodies have no faces that mate - you can skip the expensive checks and move on to the next pair of solid bodies. If the distance is within your "mating tolerance", the points returned from the function will give you a good idea of which faces mate.

www.nxjournaling.com

RE: Identify mating faces using NXOpen API ?

(OP)
Thank you for your suggestion, Cowski. I understand the solid bodies based distance validation. How can I use the points returned by the function to get an idea of which faces mate? Is there some NX API that provides a nearby face to a point ?

Thank You,
Amitabh

RE: Identify mating faces using NXOpen API ?

Quote (biw01)

Is there some NX API that provides a nearby face to a point?

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 ?

consider ask distance between components, and iterate over bodies only in pair of components that have minimum distance.

RE: Identify mating faces using NXOpen API ?

(OP)
Thank you, cowski. I bow to you. The TraceARay method is very quick and with some additional validations, I am able to quickly find out a mating face between 2 bodies. I am currently testing this method in different scenarios and I might need your guidance if I encounter some issue.

Thank You,
Amitabh

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources