VBA & Circular Patterns

VBA & Circular Patterns

isocam
Collaborator Collaborator
523 Views
0 Replies
Message 1 of 1

VBA & Circular Patterns

isocam
Collaborator
Collaborator

Can anybody help????

 

I have a part (ipt) containing various holes drilled on various pitch circle diameters (see attached part)

 

The part in question has 3 separate circular patterns,

 

Does anybody know how I can tell what sketch goes with what pattern?

 

I have the following macro that I am using but it crashes on the line

 

Set oParentFeature = oCP.ParentFeatures.Item(1)

 

this is the macro:-

 

Public Function ArrayGeometry(Doc As PartDocument, sketch As PlanarSketch)  

Dim oDef As PartComponentDefinition

Set oDef = Doc.ComponentDefinition

Dim oPar As Inventor.Parameter

Dim oFPE As FeaturePatternElement

Dim oParentFeature As ExtrudeFeature

Dim oSketch As PlanarSketch

Dim oCP As CircularPatternFeature

 

For Each oCP In oDef.Features.CircularPatternFeatures

Set oCP = oDef.Features.CircularPatternFeatures.Item(oCP.Name)

 

Set oParentFeature = oCP.ParentFeatures.Item(1) THIS IS THE PROBLEM LINE!!!

Set oSketch = oParentFeature.Profile.Parent

 

If oSketch.Name = sketch.Name Then  MsgBox "entity is part of " + Ocp.Name   

End Function

 

Any help would be appreciated!!!!!

 

Many thanks in advance

 

IsoCAM

0 Likes
524 Views
0 Replies
Replies (0)