Showing results for 
Search instead for 
Did you mean: 

Creating Patterns of Features

Valued Contributor
Valued Contributor



I have been struggling to create patterns of features in SE part using 2005 with SE v.18, and wondering if anyone can help me. I am trying to make a pattern of holes (objHol) in a circular pattern. The base featrue is a revolved protrusion Here is the code I have so far:


'Create a new Profile object

objProfile = objDoc.ProfileSets.Add.Profiles.Add(objDoc.RefPlanes(1))


'Get the CircularPatterns2d object on the Profile

objCPatterns = objProfile.CircularPatterns2d


'Add an item to the CircularPatterns2d collection

objCPattern = objCPatterns.AddByCircle(CenterX:=0.0, CenterY:=0.0, StartX:=0.025,_ StartY:=0.0, Orientation:=SolidEdgeFrameworkSupport.Geom2dOrientationConstants._ igGeom2dOrientCounterClockwise, OffsetType:=SolidEdgeFrameworkSupport._ PatternOffsetTypeConstants.sePatternFillOffset, Count:=5, AngularSpacing:=20 * PI / 180)


'Declare the feature array

Dim objFeatArray As Array = Array.CreateInstance(GetType(Object), 1)

objFeatArray.SetValue(objHol, 0)


'Create the pattern

objPattern = objFinRevProt.Patterns.Add(NumberOfFeatures:=1, FeatureArray:=objFeatArray,_ Profile:=objProfile, PatternType:=SolidEdgePart.PatternTypeConstants.seSmartPattern)


When I run this code I get a type mismatch error, I think it may be related to the array of features...The pattern profile looks fine, it's only last line of code where the pattern is supposed to be created that is causing the problem.


Any help would be greatly appreciated!


Posted by: Ryan Kilpatrick
Post date: 10/23/2006 2:32:33 AM