Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Vladimir.Ananyev
in reply to: Anonymous

Here is the sample to proof the concept.

It adds the second extrude feature (disk) to the existing circular pattern feature.

Open the attached part file and run the iLogic rule.

 

'this rule adds one more feature 
'to the existing circular pattern Feature

Dim oDoc As PartDocument = ThisDoc.Document
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition

'Feature to be added to the existing pattern
'Should be above the pattern node in the browser!
Dim oPartFeature As PartFeature = oDoc.ComponentDefinition _
		.Features.ExtrudeFeatures.Item("Disk")

'reference to the circular pattern feature
Dim oCPF As CircularPatternFeature = oDef.Features.CircularPatternFeatures.Item(1)

'get the feature collection
Dim objCol As ObjectCollection = oCPF.ParentFeatures
'modify the object collection - add one more extrude feature
Call objCol.Add(oPartFeature)

'apply changes to the pattern
oCPF.ParentFeatures = objCol

oDoc.Update
Beep

 Initial state:

Before.PNG

 

Result:

After.PNG

cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network