Evaluation like holeTable

Evaluation like holeTable

Anonymous
Not applicable
265 Views
1 Reply
Message 1 of 2

Evaluation like holeTable

Anonymous
Not applicable

Hy, i am quiet new in inventor API.

In a part or assembly i want to find all holes. i can access all the holeFeatures, but if the user has copied or mirrored the feature, the hole itself is not in the list

 

i have found this code

 

...

      Try
            Dim oDoc As PartDocument
            oDoc = _invApp.ActiveDocument

            Dim oDef As PartComponentDefinition
            oDef = oDoc.ComponentDefinition

            Dim lHoleFeatureCount As Long
            lHoleFeatureCount = oDef.Features.HoleFeatures.Count

            Dim lHoleCount As Long
            lHoleCount = 0

            Dim oHoleFeature As HoleFeature
            For Each oHoleFeature In oDef.Features.HoleFeatures
                lHoleCount = lHoleCount + oHoleFeature.HoleCenterPoints.Count
            Next

            MsgBox("There are " & lHoleFeatureCount & " hole features and " & _
               lHoleCount & " holes in the part.")
        Catch ex As Exception
            showCatchMessage("Irgendwas ging schief!", ex.Message)
        End Try

...

 

In a drawing i can place a holeTable with all the holes inside.

 

What is the right access to reach also those holes, which do not come directly from the HoleFeature.

 

 

Thanks for any kind of help

0 Likes
266 Views
1 Reply
Reply (1)
Message 2 of 2

YuhanZhang
Autodesk
Autodesk

Can you refer to this post: http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/How-can-I-get-all-the-holes-in-a-Part-....



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