Get Started
Usage API
More information

CreateGroup

CreateGroup(aDrawings) → { ApiGroup }

Creates a group of drawings.

Parameters:

Name Type Description
aDrawings Array

The array of drawings.

Returns:

Type
ApiGroup

Example

Copy code
builder.CreateFile("pptx");
var oPresentation = Api.GetPresentation();
var oSlide = oPresentation.GetSlideByIndex(0);
oSlide.RemoveAllObjects();
var oFill1 = Api.CreateSolidFill(Api.CreateRGBColor(61, 74, 107));
var oFill2 = Api.CreateSolidFill(Api.CreateRGBColor(100, 0, 0));
var oStroke = Api.CreateStroke(0, Api.CreateNoFill());
var oShape1 = Api.CreateShape("rect", 300 * 36000, 130 * 36000, oFill1, oStroke);
var oShape2 = Api.CreateShape("rect", 150 * 36000, 80 * 36000, oFill2, oStroke);
var oGroup = Api.CreateGroup([oShape1, oShape2]);
oShape1.SetPosition(608400, 1267200);
oShape2.SetPosition(3100000, 1867200);
oSlide.AddObject(oGroup);
builder.SaveFile("pptx", "CreateGroup.pptx");
builder.CloseFile();

Resulting document