Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Journal" How get information about hole from pattern feture

Status
Not open for further replies.

MANox

Mechanical
Apr 2, 2007
121
Hello,

I try get information about all holes and their paramters in model with journal.
And I have litte problem with holes creates with pattern feature.
I dont know how get information about parent feature from pattern:

Code:
    Public Function ReadList(featureList As List(Of Features.Feature)) As List(Of HoleInfo)
        Dim listOfHoles As New List(Of HoleInfo)
        For Each feature1 As Features.Feature In featureList
            If Mid(feature1.GetFeatureName, 1, 7) = "Pattern" Then
                Dim patternFeatureBuilder1 As NXOpen.Features.PatternFeatureBuilder = Utilities.NXObjectManager.Get(feature1.Tag)
                Dim holePackage1() As NXOpen.Features.HolePackage
                holePackage1 = patternFeatureBuilder1. ???????????????????????????????????????????????????????
            End If
        Next
        Return listOfHoles
    End Function


Maybe somebody can help.

Best regards

MANok
NX2207
TC14
 
Replies continue below

Recommended for you

patternFeatureBuilder1.FeatureList should have it.

Depending on the designer's "creativity," the list may have more than one feature, even more than one hole package, so you'll need to look for the one you need in there.
 
Bleker,

thanks for help. It's very usefull for me.

I have another problem:

Pattern feature has three method: Simple, Single and Variational:
I use this code for find all HolePackages in features of myComponent:
CODE --> vb

Dim featureHolePakage As New List(Of Features.Feature)

For Each partFeature As Features.Feature In myComponent.Prototype.OwningPart.Features

If TypeOf (partFeature) Is Features.PatternFeature Then
Try
Dim myPatternFeat As Features.PatternFeature = Utilities.NXObjectManager.Get(partFeature.Tag)
Dim patternFeatureBuilder1 As NXOpen.Features.PatternFeatureBuilder = workPart.Features.CreatePatternFeatureBuilder(myPatternFeat)
Dim patternFeatureList As Features.Feature() = patternFeatureBuilder1.FeatureList.GetArray()

For Each dummyfeature As Features.Feature In patternFeatureList
If TypeOf (dummyfeature) Is Features.HolePackage Then
featureHolePakage.Add(dummyfeature)
End If

Next
patternFeatureBuilder1.Destroy()
Catch e As NXException
End Try
ElseIf TypeOf (partFeature) Is Features.HolePackage Then
featureHolePakage.Add(partFeature)
End If
Next


For two first method it's work ok, but for variational method, one time it find pattern as Features.PatternFeature and after as Features.HolePackage.
And I have duplicate feature on my List.

Mayby somebody work with it and know way to select only one this feature.

Best regards

MANok
NX2207
TC14
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor