Skip to main content

GetClassType

Returns a type of the ApiStroke class.

Syntax

expression.GetClassType();

expression - A variable that represents a ApiStroke class.

Parameters

This method doesn't have any parameters.

Returns

"stroke"

Example

Read the type label of a border object attached to a shape in a spreadsheet.

// How do I find out what kind of object a shape's border is in a spreadsheet?

// Check the category name of a stroke to confirm it is the expected border type in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let gradientStop1 = Api.CreateGradientStop(Api.RGB(255, 213, 191), 0);
let gradientStop2 = Api.CreateGradientStop(Api.RGB(255, 111, 61), 100000);
let fill = Api.CreateLinearGradientFill([gradientStop1, gradientStop2], 5400000);
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
worksheet.AddShape("flowChartOnlineStorage", 60 * 36000, 35 * 36000, fill, stroke, 0, 2 * 36000, 1, 3 * 36000);
let classType = stroke.GetClassType();
worksheet.SetColumnWidth(0, 15);
worksheet.SetColumnWidth(1, 10);
worksheet.GetRange("A1").SetValue("Class Type = ");
worksheet.GetRange("B1").SetValue(classType);