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

Rectangular Pattern of Feature vs Solid Body

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