VS:GetNumGradientSegments

From Vectorworks Developer
Revision as of 14:32, 12 August 2013 by Root (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

.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