Could You help me How can I create closed profile in VBA
Suppose this profile includes Line and Spline
See attached code in vb
Later I cannot create Extrude feature because previously
created profile is open (consists of two separate curves)
Could You help me How can I join together points in
profile which belongs to separate curves to get one curve.
I know that this is simple :), but ... I could not find the solution.
Thx for all Your help.
Regards
Dim t As Inventor.TransientGeometry
Set t = ThisApplication.TransientGeometry
Dim c As Inventor.ComponentDefinition
Set c = ThisApplication.ActiveDocument.ComponentDefinition
Dim wpts As Inventor.WorkPoints
Set wpts = c.WorkPoints
Dim wp0 As Inventor.WorkPoint
Set wp0 = wpts.AddFixed(t.CreatePoint(0, 0, 0))
Dim wp1 As Inventor.WorkPoint
Set wp1 = wpts.AddFixed(t.CreatePoint(1, 0, 0))
Dim wp2 As Inventor.WorkPoint
Set wp2 = wpts.AddFixed(t.CreatePoint(0, 1, 0))
wp2.Visible = False
Dim wpls As Inventor.WorkPlanes
Set wpls = c.WorkPlanes
Dim wpl As Inventor.WorkPlane
Set wpl = wpls.AddByThreePoints(wp0, wp1, wp2)
wpl.Visible = False
Dim s As Inventor.PlanarSketch
Set s = c.Sketches.Add(wpl)
Dim oc As ObjectCollection
Set oc = ThisApplication.TransientObjects.CreateObjectCollection
Call oc.Add(t.CreatePoint2d(0, 0))
Call oc.Add(t.CreatePoint2d(1, 0))
Call oc.Add(t.CreatePoint2d(0, 1))
Dim sp As Inventor.SketchSpline
Set sp = s.SketchSplines.Add(oc)
Dim sl As Inventor.SketchLine
Set sl = s.SketchLines.AddByTwoPoints(t.CreatePoint2d(0, 0),
t.CreatePoint2d(0, 1))