Description Sets the data of a specified Segmented Curve in the associated FRED document.
Syntax SetSegmentedCurve n, ent, points
Parameters n As Long Node number of the Segmented Curve.
ent As T_ENTITY The new generic entity data for the Segmented 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 and the second dimension contains the point index. For example, a segmented curve representing a rectangle would have dimensions points(2,4).
The following script retrieves a segmented curve's information, redefines the points and sets the new values back to the document.
Dim ent As T_ENTITY Dim points() As Double Dim cNode As Long
'get the node number of the curve of interest cNode = FindFullName( "Geometry.Custom Element.Catadioptric Curve" )
'get the current curve values GetSegmentedCurve cNode, ent, points()
'redefine the points in the curve ReDim points(2,4) points(0,0) = 2 : points(1,0) = 2 : points(2,0) = 0 points(0,1) = -2 : points(1,1) = 2 : points(2,1) = 0 points(0,2) = -2 : points(1,2) = -2 : points(2,2) = 0 points(0,3) = 2 : points(1,3) = -2 : points(2,3) = 0 points(0,4) = 2 : points(1,4) = 2 : points(2,4) = 0
'set the new values back to the curve node SetSegmentedCurve cNode, ent, points()
Update
See Also
Examples
|