Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA & Circular Patterns

0 REPLIES 0
Reply
Message 1 of 1
isocam
460 Views, 0 Replies

VBA & Circular Patterns

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 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report