I'm trying to connect two solid model profiles in Autodesk Inventor using VBA scripting. I came as far as drawing the 3D lines which are supposed to act as profiles later on. After the script has finished drawing, I can select the two loops and connect them using the loft operation through the GUI. I'm thinking that should be possible from the script, too, I just can't figure out how. Here's my script so far:
Sub loft()
Set oDoc = ThisApplication.Documents.Add(kPartDocumentObject, , True)
Set oPartDef = oDoc.ComponentDefinition
Dim osketch3D As Sketch3D
Set osketch3D = oPartDef.Sketches3D.Add()
Set oTG = ThisApplication.TransientGeometry
Dim wire(198) As SketchLine3D
Set wire(0) = osketch3D.SketchLines3D().AddByTwoPoints(oTG.CreatePoint(0, 0, 0), oTG.CreatePoint(10, 0, 0))
Set wire(1) = osketch3D.SketchLines3D().AddByTwoPoints(oTG.CreatePoint(10, 0, 0), oTG.CreatePoint(10, 10, 1))
Set wire(2) = osketch3D.SketchLines3D().AddByTwoPoints(oTG.CreatePoint(10, 10, 1), oTG.CreatePoint(0, 10, 0))
Set wire(3) = osketch3D.SketchLines3D().AddByTwoPoints(oTG.CreatePoint(0, 10, 0), oTG.CreatePoint(0, 0, 0))
Set wire(4) = osketch3D.SketchLines3D().AddByTwoPoints(oTG.CreatePoint(0, 0, 5), oTG.CreatePoint(10, 0, 5))
Set wire(5) = osketch3D.SketchLines3D().AddByTwoPoints(oTG.CreatePoint(10, 0, 5), oTG.CreatePoint(10, 10, 5))
Set wire(6) = osketch3D.SketchLines3D().AddByTwoPoints(oTG.CreatePoint(10, 10, 5), oTG.CreatePoint(0, 10, 5))
Set wire(7) = osketch3D.SketchLines3D().AddByTwoPoints(oTG.CreatePoint(0, 10, 5), oTG.CreatePoint(0, 0, 5))
' .....
' Select wires 0-3 and 4-7 as profiles, put them in an object collection and call the loft op.
End Sub