Skip to main content
Version: v26

IShapesGroupControllerApi

Interface

Drawing Groups API.

Methods

addShapeToGroup

Add a drawing to a group.

Signature

addShapeToGroup(groupId: ShapesGroupId, shapeId: EntityId) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.
shapeIdEntityIdA drawing ID.

Returns

void


availableZOrderOperations

Get an object containing the available Z-order operations for a group.

Signature

availableZOrderOperations(groupId: ShapesGroupId) => AvailableZOrderOperations

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns

The available Z-order operations.

AvailableZOrderOperations


bringForward

Move the group one level up in the Z-order.

Signature

bringForward(groupId: ShapesGroupId) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns

void


bringToFront

Move the group to the top of the Z-order.

Signature

bringToFront(groupId: ShapesGroupId) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns

void


canBeGroupped

Check if some drawings can be grouped.

Signature

canBeGroupped(shapes: readonly EntityId[]) => boolean

Parameters

NameTypeDescription
shapesreadonly EntityId[]An array of drawing IDs.

Returns

true if the drawings can be grouped, false otherwise.

boolean


createGroupFromSelection

Create a group of drawings from the selection.

Throws

If selection is empty, or selection contains non-drawings, or selection contains drawings from more than one pane.

Signature

createGroupFromSelection() => ShapesGroupId

Returns

The ID of the created group.

ShapesGroupId


excludeShapeFromGroup

Remove a drawing from a group. If the drawing is the only drawing in the group then the group is also removed.

Signature

excludeShapeFromGroup(groupId: ShapesGroupId, shapeId: EntityId) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.
shapeIdEntityIdA drawing ID.

Returns

void


getGroupName

Get the name of a group.

Signature

getGroupName(groupId: ShapesGroupId) => string

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns

The name of the group.

string


groupLock

Get locked state of a group.

Signature

groupLock(groupId: ShapesGroupId) => GroupLockState

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns

The locked state.

GroupLockState


groupVisibility

Get the visibility state of a group.

Signature

groupVisibility(groupId: ShapesGroupId) => GroupVisibilityState

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns

The visibility state.

GroupVisibilityState


groups

Get an array of all drawing groups.

Signature

groups() => readonly ShapesGroupId[]

Returns

An array of group IDs.

readonly ShapesGroupId[]


insertAfter

Move the group immediately below the target in the Z-order.

Signature

insertAfter(groupId: ShapesGroupId, target: EntityId | ShapesGroupId) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.
targetEntityId | ShapesGroupIdA target ID.

Returns

void


insertBefore

Move the group immediately above the target in the Z-order.

Signature

insertBefore(groupId: ShapesGroupId, target: EntityId | ShapesGroupId) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.
targetEntityId | ShapesGroupIdA target ID.

Returns

void


removeGroup

Remove a group of drawings.

Signature

removeGroup(groupId: ShapesGroupId) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns

void


sendBackward

Move the group one level down in the Z-order.

Signature

sendBackward(groupId: ShapesGroupId) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns

void


sendToBack

Move the group to the bottom of the Z-order.

Signature

sendToBack(groupId: ShapesGroupId) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns

void


setGroupLock

Lock or unlock a group.

Signature

setGroupLock(groupId: ShapesGroupId, value: boolean) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.
valuebooleanA boolean flag. true to lock, false to unlock.

Returns

void


setGroupName

Set the name of a group. Names do not need to be unique.

Signature

setGroupName(groupId: ShapesGroupId, name: string) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.
namestringThe new name of the group.

Returns

void


setGroupVisibility

Show or hide all drawings in a group.

Signature

setGroupVisibility(groupId: ShapesGroupId, value: boolean) => void

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.
valuebooleanA boolean flag. true to show, false to hide.

Returns

void


shapesInGroup

Get an array of IDs for each drawing in a group.

Signature

shapesInGroup(groupId: ShapesGroupId) => readonly EntityId[]

Parameters

NameTypeDescription
groupIdShapesGroupIdA group ID.

Returns

An array of drawing IDs.

readonly EntityId[]