To create a lofted flange, you need to create LoftedFlangeDefinition and add it to produce LoftedFlangeFeature. The LoftedFlangeDefinition needs two paths which define the shape of the lofted flange. Use PartFeatures.CreatePath method to create this path.
Sub LoftedFlangeFeatures()
' assume you have had Inventor Application _InvApplication
Dim oTG As TransientGeometry =
_InvApplication.TransientGeometry
' get active sheet metal part
Dim oPartDoc As PartDocument =
_InvApplication.ActiveDocument
' get definition
Dim oPartDef As SheetMetalComponentDefinition =
oPartDoc.ComponentDefinition
'create first sketch
Dim oSketch1 As PlanarSketch =
oPartDef.Sketches.Add(oPartDef.WorkPlanes(3))
'create second sketch
Dim oWP As WorkPlane =
oPartDef.WorkPlanes.AddByPlaneAndOffset(
oPartDef.WorkPlanes(3), 5)
Dim oSketch2 As PlanarSketch =
oPartDef.Sketches.Add(oWP)
' create circles in each sketch
Dim oSketchCircle1 As SketchCircle =
oSketch1.SketchCircles.AddByCenterRadius(
oTG.CreatePoint2d(0, 0), 1)
Dim oSketchCircle2 As SketchCircle =
oSketch2.SketchCircles.AddByCenterRadius(
oTG.CreatePoint2d(0, 0), 2)
' get SheetMetalFeatures
Dim oSheetFs As SheetMetalFeatures
oSheetFs = oPartDef.Features
' create path1 and path2 for LoftedFlangeDefinition
Dim oPath1 As Inventor.Path =
oSheetFs.CreatePath(oSketchCircle1)
Dim oPath2 As Inventor.Path =
oSheetFs.CreatePath(oSketchCircle2)
' create LoftedFlangeDefinition
Dim oLFDef As LoftedFlangeDefinition =
oSheetFs.LoftedFlangeFeatures.
CreateLoftedFlangeDefinition(oPath1,
oPath2)
'add LoftedFlangeFeature
Dim oLFF As LoftedFlangeFeature =
oSheetFs.LoftedFlangeFeatures.Add(oLFDef)
End Sub