Use the following editable properties to change splines:
Specifies the control points of a spline.
Specifies the end tangent of the spline as a directional vector.
Specifies all the fit points of a spline.
Refits the spline to the existing points with new tolerance values.
Specifies the knots vector for the spline.
Specifies the start tangent for the spline.
In addition, you can use the following methods to edit splines:
Adds a single fit point to the spline at a given index.
Deletes the fit point of a spline at a given index.
Elevates the order of the spline to the given order.
Gets the fit point of the spline at a given index. (Gets one fit point only. To query all the fit points of the spline, use the FitPoints property.)
Reverses the direction of a spline.
Sets the control point of the spline at a given index.
Sets the fit point of the spline at a given index. (Sets one fit point only. To change all the fit points of the spline, use the FitPoints property.)
Sets the weight of the control point at a given index.
Use the following read-only properties to query splines:
Gets the enclosed area of a spline.
Indicates whether the spline is open or closed.
Gets the degree of the spline's polynomial representation.
Specifies if the given spline is periodic.
Specifies if the given spline is planar.
Specifies if the given spline is rational.
Gets the number of control points of the spline.
Gets the number of fit points of the spline.
For more information about editing splines, see “Modify Splines” in the User's Guide.
Change a control point on a spline
This example creates a spline and then changes the first control point for the spline.
Sub Ch4_ChangeSplineControlPoint()
' Create the spline
Dim splineObj As AcadSpline
Dim startTan(0 To 2) As Double
Dim endTan(0 To 2) As Double
Dim fitPoints(0 To 8) As Double
startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0
endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0
fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0
fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0
fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0
Set splineObj = ThisDrawing.ModelSpace. _
AddSpline(fitPoints, startTan, endTan)
splineObj.Update
' Change the coordinate of the first fit point
Dim controlPoint(0 To 2) As Double
controlPoint(0) = 0
controlPoint(1) = 3
controlPoint(2) = 0
splineObj.SetControlPoint 0, controlPoint
splineObj.Update
End Sub