Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Hey Sergio,

 

I am trying to add a Rectangular pattern onto the newly created sweep but it doesn't seem to work. Here's what I've tried so far:

 

Dim oPartDoc As PartDocument = ThisDoc.Document
Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
' Create a profile.
Dim oSketch1 As Sketch = oCompDef.Sketches.Item("Sketch1")
Dim oProfile As Profile = oSketch1.Profiles.AddForSolid
' Create a path.
Dim oSketch2 As Sketch = oCompDef.Sketches.Item("Sketch2")
Dim oPath As Path = oCompDef.Features.CreatePath(oSketch2.SketchLines(1))

' Create the sweep feature.
Dim oSweep As SweepFeature = oCompDef.Features.SweepFeatures.AddUsingPath(oProfile, oPath, kJoinOperation)
oSweep.Name = "Test"

'Dim TestPattern As RectangularPatternFeature = oCompDef.Features.RectangularPatternFeatures.Add("TestPattern", 3, 20 in, Nothing, "X Axis")
'Dim TestPatter0 As RecantgularPatternFeature = oCompDef.Features.RectangularPatternFeatures
'TestPatter0.CreateDefinition("Test", "X Axis", True, 3, "20 in")
Dim TestPattern As RecantgularPatternFeature = oCompDef.Features.RectangularPatternFeatures.CreateDefinition("Test", "X Axis", True, 3, "20 in")

The code fails on the last line.