Skip to main content

GetClassType

Returns a type of the ApiGradientStop class.

Syntax

expression.GetClassType();

expression - A variable that represents a ApiGradientStop class.

Parameters

This method doesn't have any parameters.

Returns

"gradientStop"

Example

Check the class type returned by a gradient stop in a document.

// How do I check what type a gradient stop object is in a document?

// Retrieve and output the class type string for a gradient stop in a document.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let gs1 = Api.CreateGradientStop(Api.RGB(255, 213, 191), 0);
let gs2 = Api.CreateGradientStop(Api.RGB(255, 111, 61), 100000);
let fill = Api.CreateRadialGradientFill([gs1, gs2]);
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
let drawing = Api.CreateShape("rect", 1908000, 1404000, fill, stroke);
drawing.SetDistances(914400, 0, 914400, 0);
drawing.SetWrappingStyle("square");
paragraph.AddDrawing(drawing);
let classType = gs1.GetClassType();
paragraph.AddText("Class Type = " + classType);