跳到主要内容

IsCustom

检查当前几何形状是否为自定义。

语法

expression.IsCustom();

expression - 表示 ApiGeometry 类的变量。

参数

此方法没有任何参数。

返回值

boolean

示例

从预设星形获取几何信息。

// Displays the preset type and checks if the geometry is custom.
let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let fill = Api.CreateSolidFill(Api.RGB(255, 200, 100));
let stroke = Api.CreateStroke(36000, Api.CreateSolidFill(Api.RGB(200, 100, 0)));
let shape = Api.CreateShape("star5", 100 * 36000, 100 * 36000, fill, stroke);
let geometry = shape.GetGeometry();
paragraph.AddText("Preset: " + geometry.GetPreset() + ", IsCustom: " + geometry.IsCustom());
paragraph.AddDrawing(shape);