Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
400 Views, 2 Replies

Getting all parameters of an holefeature

Hi All,

 

i am writing a rule wich accsesses the parameters of the holefeatures in my parts.

When i use the code below on a part with a counterbore hole it only returns the parameter of the drilled part and ingnores the 

depth and the diameter of the counterbore.

 

I attached the partfile with the rule.

 

 

SyntaxEditor Code Snippet

Dim oDoc as Inventor.PartDocument = ThisDoc.Document
Dim oParam as Inventor.Parameter
Dim oTol as Inventor.Tolerance
Dim i As Integer
Dim oFeat As PartFeature
Dim oDim as FeatureDimension

For i=1 To oDoc.ComponentDefinition.Features.count
    oFeat=oDoc.componentdefinition.Features.item(i)

    If oFeat.Type = 83912192 Then        '83912192 = Holefeatures

        For n=1 To oFeat.FeatureDimensions.count
        oDim=oFeat.FeatureDimensions.item(n)
        oParam = oDim.Parameter

               MessageBox.Show(oFeat.Type & oParam.Name & oParam.Tolerance.HoleTolerance, " ", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)

        Next
    End If
Next