Message 1 of 2
How to find if a parent feature in a pattern is a hole feature.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Below is a snip of the code I am writing.
I am looking to separate pattern that uses a hole feature as the parent from other pattern features.
Dim RectFeat As RectangularPatternFeature = DirectCast(feat, RectangularPatternFeature)
' Check if the pattern feature is a hole pattern
Dim kHoleFeatureObject As Inventor.ObjectTypeEnum = Inventor.ObjectTypeEnum.kHoleFeatureObject
If RectFeat.Definition.AffectedBodies.Type = kHoleFeatureObject Then
Dim holePattern As HoleFeature = DirectCast(RectFeat.PatternFeatureDefinition.ParentFeatures, HoleFeature)
Dim holeSideFaces As Faces = holePattern.Faces
Dim i As Integer = 1
For Each holeSideFace As Face In holeSideFaces
Dim iMateDef As InsertiMateDefinition = CompDef.iMateDefinitions.AddInsertiMateDefinition(holeSideFace, True, 0, , featName & "-" & i)
i = i + 1
Next
End If
Any help or advice would be much appreciated thank you.