Skip to main content

GetDrawingsByPlaceholderType

Returns an array of drawings by the specified placeholder type.

Syntax

expression.GetDrawingsByPlaceholderType(sType);

expression - A variable that represents a ApiLayout class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sTypeRequiredPlaceholderTypeThe placeholder type.

Returns

Drawing[]

Example

Get drawings by placeholder type from a layout and remove them.

// Drawings with specific placeholder types can be filtered and deleted.

// Delete all drawings with the "ctrTitle" placeholder type from the layout.

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

let drawingsWithPh = layout.GetDrawingsByPlaceholderType("ctrTitle");
for (let i = 0; i < drawingsWithPh.length; i++) {
drawingsWithPh[i].Delete();
}