Cancel
Showing results for
Did you mean:

# Finding co-axial holes

Solution Partner Genius

Hello everyone!

Let's assume we have Part 1 and Part 2, both have holes. Is it possible in NX Open to pick a hole in Part 1 and find if there is any hole in Part 2 that is co-axial to it?

Does easy way exist? Or maybe it is possible, but only with the complex code?

34 REPLIES

# Re: Finding co-axial holes

Genius
I do not know any "simple way" but in general you need to do something like:
* Get the direction of the "template hole"
* Get every other direction and compare it to the "template direction.

You have to consider that the modeling tolerance can be important here. Vector arithmetic could be helpful here. The direction vector could be read from the hole feature.

# Re: Finding co-axial holes

Gears Esteemed Contributor

If the holes in the parts were created with the "hole series" feature, it won't be too difficult to relate them. If they are individual, unrelated hole features then a search procedure, like that indicated by @josch will be required.

# Re: Finding co-axial holes

Siemens Phenom

Are you only concerned about the vector direction of the hole axis, or are you also concerned about location - that is, whether the holes are aligned such that a bolt could go through both holes at the same time?

Are the parts components in an assembly, or two stand-alone piece parts?

# Re: Finding co-axial holes

Gears Esteemed Contributor

If they are co-axial, you would need to text both the axis vectors & the "point" used to define where it is.

Note the points may be different in space, but the one point would have to lie on the vector determined by the other point & axis vector

Also make sure you get the point/axis data in  the csys of the ASSEMBLY, not the component.

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled

# Re: Finding co-axial holes

Siemens Phenom

Get the two centerline vectors. Determine if they are parallel:

• If the cross product between them is 0.
• Normalize them and compute the dot product. If it is 1, they are parallel

To determine if they are colinear, check to see if the distance from one of the endpoints of one vector lies on the other vector:

http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html

All of the vector tools you need can be found in the classes:

• NXOpen.VectorArithmetic.Vector3
• NXOpen.UF.UFVec3

Actually, NXOpen.UF.UFVec3.IsEqual() may do what you want in one shot. The documentation is not very good so I'm not sure what is meant by "equal" (length, direction, etc.)

# Re: Finding co-axial holes

Solution Partner Genius

Are you only concerned about the vector direction of the hole axis, or are you also concerned about location - that is, whether the holes are aligned such that a bolt could go through both holes at the same time?

Yes, I am concerned about location too.

Are the parts components in an assembly, or two stand-alone piece parts?

Components in an aseembly.

# Re: Finding co-axial holes

Master

http://youtu.be/Hn-19pjB0Pw

see this video. Is this the job you have to do?

# Re: Finding co-axial holes

Solution Partner Genius

Somewhat, but far from being exactly that job. And not using Java.

But the video suggests that the solution does exist, and that's encouraging.

# Re: Finding co-axial holes

Phenom

Try to use DFMPro that have your control.

Thank you...

Using NX 11 / RuleDesigner PDM