Suppress Pattern Occurrence Element with Macro or API?

Suppress Pattern Occurrence Element with Macro or API?

Anonymous
Not applicable
1,486 Views
2 Replies
Message 1 of 3

Suppress Pattern Occurrence Element with Macro or API?

Anonymous
Not applicable

I need to be able to suppress individual elements of a circular pattern so I can retain the angular orientation while being able to reduce the number of instances.  I have found how to suppress the entire circular pattern, but can't seem to get the right terminology to access the elements one at a time.

 

The code I have to suppress the entire pattern is Feature.InventorFeature("Circular Pattern").Suppressed = True

 

Thanks.

Shane

 

0 Likes
Accepted solutions (1)
1,487 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

 

Dim oPartDoc as PartDocument
oPartDoc = ThisApplication.ActiveDocument
Dim oPattern As CircularPatternFeature
oPattern = oPartDoc.ComponentDefinition.Features.CircularPatternFeatures.Item(3)
oPattern.PatternElements.Item(4).Suppressed=True
oPartDoc.update

Drove me crazy, the code would run without any changes, then I noticed "Update" needed to be used.

 

This works.

Message 3 of 3

Anonymous
Not applicable

Also found that you can access a feature by name for the same purpose.

 

oPattern1 = Feature.InventorFeature("Circular Pattern 1")

 

Then use a FOR loop to check if each element is suppressed or suppressed individual elements.

 

Works great!