How can I get all the holes in a Part/Assembly ?

How can I get all the holes in a Part/Assembly ?

Anonymous
Not applicable
1,472 Views
5 Replies
Message 1 of 6

How can I get all the holes in a Part/Assembly ?

Anonymous
Not applicable

There are many ways in which a hole can be created.

Obviously the right way is to created it by using Hole feature.

The other ways are by using Extrusion, Sweep, Loft , Revolve etc.

 

My objective is to get all the holes irrespective of how it is created.

Pl guide if any buddy has any idea?

0 Likes
Accepted solutions (1)
1,473 Views
5 Replies
Replies (5)
Message 2 of 6

YuhanZhang
Autodesk
Autodesk
Accepted solution

My idea is that you can traverse over all the faces and find out how many cylindrical faces, and also check if the cylindrical faces have their normal pointing to their axis(inner cylindrical faces) or not(outter cylindrical faces). The inner cylindrical faces are the holes you want to get.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 6

Anonymous
Not applicable

Thanks

The other thing I want to check is whether it is a flat bottom or conical.

How can we get the bottom face for the cylinder?

0 Likes
Message 4 of 6

Ralf_Krieg
Advisor
Advisor

Hello

 

Each of your cylindrical face has a CreatedByFeature-Object. This object has a Faces-Object. The one face is your cylindrical face and the other is the bottom face. The SurfaceType of this face could be kPlaneSurface or kConeSurface. If the Faces-Object has only one face, your hole is through the whole part.


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 5 of 6

Anonymous
Not applicable

Thanks krieq

Its working now.

Thanks a lot

0 Likes
Message 6 of 6

Gabriel_Watson
Mentor
Mentor

@YuhanZhang wrote:

My idea is that you can traverse over all the faces and find out how many cylindrical faces, and also check if the cylindrical faces have their normal pointing to their axis(inner cylindrical faces) or not(outter cylindrical faces). The inner cylindrical faces are the holes you want to get.


I am trying to test faces to find if they are holes or cylinders, but I found almost no reference on how to do this. Please help if you can. Below is what my intent is, but not how the code should be written:

If oFace.Normal = oFace.Geometry.AxisVector Then MsgBox("Cylinder is a hole.")
0 Likes