跳到主要内容

IsCustom

Checks whether the current geometry is custom.

Syntax

expression.IsCustom();

expression - A variable that represents a ApiGeometry class.

Parameters

This method doesn't have any parameters.

Returns

boolean

Example

Gets geometry information from a star shape on a presentation slide.

// Displays preset type and custom status in a text shape.
let presentation = Api.GetPresentation();
let slide = presentation.GetSlideByIndex(0);
let fill = Api.CreateSolidFill(Api.CreateRGBColor(255, 200, 100));
let stroke = Api.CreateStroke(36000, Api.CreateSolidFill(Api.CreateRGBColor(200, 100, 0)));
let shape = Api.CreateShape("star5", 100 * 36000, 100 * 36000, fill, stroke);
let geometry = shape.GetGeometry();
shape.GetDocContent().GetElement(0).AddText("Preset: " + geometry.GetPreset() + ", IsCustom: " + geometry.IsCustom());
shape.SetPosition(1000000, 1000000);
slide.AddObject(shape);