Skip to main content

GetNextShape

Returns the next inline shape if exists.

Syntax

expression.GetNextShape();

expression - A variable that represents a ApiShape class.

Parameters

This method doesn't have any parameters.

Returns

ApiShape | null

Example

This example shows how to get the next inline shape.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let gs1 = Api.CreateGradientStop(Api.CreateRGBColor(255, 213, 191), 0);
let gs2 = Api.CreateGradientStop(Api.CreateRGBColor(255, 111, 61), 100000);
let fill = Api.CreateLinearGradientFill([gs1, gs2], 5400000);
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
let shape1 = Api.CreateShape("rect", 3212465, 963295, fill, stroke);
paragraph.AddDrawing(shape1);
let shape2 = Api.CreateShape("wave", 3212465, 963295, fill, stroke);
paragraph.AddDrawing(shape2);
let nextShape = shape1.GetNextShape();
fill = Api.CreateSolidFill(Api.CreateRGBColor(51, 51, 51));
nextShape.Fill(fill);