Q:
How to copy a SketchSpline from one Sketch to another one?
A:
The following VB.Net code snippet illustrates how to do that. Note that for clarity error checking has been omitted.
Sub TestCopy(ByVal app As Inventor.Application)
Dim doc As PartDocument = app.ActiveDocument
Dim compDef As PartComponentDefinition = doc.ComponentDefinition
Dim sketchTo As PlanarSketch = compDef.Sketches.Item(2)
Dim spline As SketchSpline =
compDef.Sketches.Item(1).SketchSplines.Item(1)
CopySpline(app, sketchTo, spline)
End Sub
Sub CopySpline(ByVal app As Inventor.Application,
ByRef sketchTo As PlanarSketch,
ByRef spline As SketchSpline)
Dim col As ObjectCollection = app.TransientObjects.CreateObjectCollection
Dim i As Integer
For i = 1 To spline.FitPointCount
col.Add(spline.FitPoint(i).Geometry)
Next
sketchTo.SketchSplines.Add(col, spline.FitMethod)
End Sub