VS:GetNumGradientSegments

From Vectorworks Developer
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Gets the number of segments in the gradient.

FUNCTION GetNumGradientSegments(
gradient :HANDLE) : INTEGER;
def vs.GetNumGradientSegments(gradient):
    return INTEGER

Parameters

gradient HANDLE The gradient from which to get the number of segments.

Return Value

Returns the number of segments in the gradient if successful; 0 otherwise.

Remarks

Note: a gradient must always have at least 2 segments.

This also returns the number of levels in a hatch definition, like [{VS:GetObjectVariableInt]](HatchDefH, 660).

Example

VectorScript

numSegments := GetNumGradientSegments(gradientHandle);

Python

numSegments = vs.GetNumGradientSegments(gradientHandle)

Version

Availability: from VectorWorks10.0