VS:GetNumGradientSegments: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
 
m (1 revision)
 
(No difference)

Latest revision as of 14:32, 12 August 2013

.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