Description Adds a new segmented curve to the document.
Syntax n = AddSegmentedCurve ( ent, points )
Parameters n (Long) Node number for the new Segmented Curve.
ent As T_ENTITY The generic curve data for the new curve.
points() As Double Array containing at least 2 sets of X, Y, Z values for points in the Segmented Curve.
Example A segmented curve is defined by contiguous straight line segments connecting the points in the points array. The array points() can be either a 1D or 2D array. If points() is a 1D array, the number of elements must be a multiple of 3 with at least 6 elements. If the array is 2D, then the first dimension contains the XYZ points (columns) and the second dimension contains the number of X,Y,Z positions (rows). For example, a segmented curve representing a rectangle would have dimensions points(2,4) as shown below.
Dim ent As T_ENTITY Dim ceNode As Long, fcNode As Long Dim points(2,4) As Double
'load the data points for the segmented curve points(0,0) = 1 : points(1,0) = 1 : points(2,0) = 0 points(0,1) = -1 : points(1,1) = 1 : points(2,1) = 0 points(0,2) = -1 : points(1,2) = -1 : points(2,2) = 0 points(0,3) = 1 : points(1,3) = -1 : points(2,3) = 0 points(0,4) = 1 : points(1,4) = 1 : points(2,4) = 0
'create a custom element and add the segmented curve InitEntity ent ent.name = "Custom Element" ceNode = AddCustomElement( ent ) InitEntity ent ent.name = "Catadioptric Curve" ent.parent = ceNode fcNode = AddSegmentedCurve( ent, points )
Update
See Also
Examples
|