跳到主要内容

GroupDrawings

在当前幻灯片母版中将绘图数组分组。

语法

expression.GroupDrawings(aDrawings);

expression - 表示 ApiMaster 类的变量。

参数

名称必需/可选数据类型默认值描述
aDrawings必需DrawingForGroup[]要分组的绘图对象数组。

返回值

ApiGroup

示例

此示例演示如何在母版幻灯片上分组绘图。

// How to group drawings on master slide.

// Create two shapes and group them. on master slide

const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
const layout = slide.GetLayout();
const master = layout.GetMaster();

const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const fill1 = Api.CreateSolidFill(Api.RGB(255, 111, 61));
const fill2 = Api.CreateSolidFill(Api.RGB(111, 255, 61));
const shape1 = Api.CreateShape("flowChartMagneticTape", 150 * 36000, 60 * 36000, fill1, stroke);
const shape2 = Api.CreateShape("flowChartMagneticTape", 150 * 36000, 60 * 36000, fill2, stroke);
shape1.SetPosition(608400, 1267200);
shape2.SetPosition(608400, 1400000);
master.AddObject(shape1);
master.AddObject(shape2);
master.GroupDrawings([shape1, shape2]);