Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi I am having an issue trying to create a simple rectangular pattern by using a SketchLine as the direction indicator. The routine works if I use an edge or WorkAxis but not a sketchline.
Here is my code:
Private Sub BtnPatternFeature_Click(sender As Object, e As EventArgs) Handles BtnPatternFeature.Click
Dim oDoc As Inventor.PartDocument = oApp.ActiveDocument
Dim oCompdef As Inventor.PartComponentDefinition = oDoc.ComponentDefinition
Dim oFeatures As PartFeatures = oCompdef.Features
Dim OselectSet As Inventor.SelectSet = oDoc.SelectSet
Dim oSketchLine As SketchLine = OselectSet.Item(1)
Dim oFeature As Inventor.PartFeature = oFeatures.Item(2)
Dim oFeatObjCollection As Inventor.ObjectCollection = oApp.TransientObjects.CreateObjectCollection
oFeatObjCollection.Add(oFeature)
Dim Count As Object = 3
Dim oSpacing As Object = 2
Dim oRPFD As RectangularPatternFeatureDefinition
Dim oGeom As GeometryIntent = oCompdef.CreateGeometryIntent(oSketchLine)
oRPFD = oCompdef.Features.RectangularPatternFeatures.CreateDefinition(oFeatObjCollection, oGeom, True, Count, oSpacing)
oCompdef.Features.RectangularPatternFeatures.AddByDefinition(oRPFD)
End Sub
I have tried using just the SketchLine and also by creating a GeometryIntent but neither worked.
Any pointers?
Thanks chaps!
Solved! Go to Solution.