- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have the code below. This code is to check for Hole features in a part.
If I have a pattern of a Solid Body then the code gives an error on the following line (if I have a pattern of any feature the code works fine):
If (TypeOf oRPF.ParentFeatures.Item(1) Is HoleFeature) Then
How can I check to see if I have a pattern of a Solid Body?
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition
Set oDef = oDoc.ComponentDefinition
Dim oRectPatterns As RectangularPatternFeatures
Set oRectPatterns = oDef.Features.RectangularPatternFeatures
Dim oRPF As RectangularPatternFeature
For Each oRPF In oRectPatterns
If Not oRPF.Suppressed Then
If (TypeOf oRPF.ParentFeatures.Item(1) Is HoleFeature) Then
‘do something
End If
End If
Next
Solved! Go to Solution.