# DrawingCollection Class

> DrawingCollection class in the TX Sheet Control TypeScript API for Node.js, with 2 properties and 8 methods and a TypeScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > TypeScript API > Node.js Server > DrawingCollection Class
- **1083 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/llms-full.txt

---

Public class for DrawingCollection.

Package: `@txtextcontrol/tx-sheet-control-server`. Version: **2.0.0**.

Related workbook object-model type, returned through the server control. Obtain it from its owning workbook or collection; it is not a required browser-package import.

### Constructor

```typescript
new DrawingCollection(sheet: Worksheet): DrawingCollection
```

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `sheet` | `Worksheet` | No | Value matching sheet's declared type and the owning object's validation rules. |

Returns: `DrawingCollection`.

### Members

#### Properties

| Property | Description |
|---|---|
| [count](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/count-property/llms-full.txt) | The count value of DrawingCollection. |
| [sheet](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/sheet-property/llms-full.txt) | The sheet value of DrawingCollection. |

#### Methods

| Method | Description |
|---|---|
| [addPicture](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/addpicture-method/llms-full.txt) | Insert an embedded picture above cells. |
| [addShape](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/addshape-method/llms-full.txt) | Insert a shape with friendly preset/anchor/size options. |
| [align](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/align-method/llms-full.txt) | Align selected objects/groups against each other. |
| [at](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/at-method/llms-full.txt) | Find by zero-based z-order index. |
| [get](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/get-method/llms-full.txt) | Find by exact drawing name; throw when absent or ambiguous. |
| [getById](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/getbyid-method/llms-full.txt) | Find by drawing identity. |
| [group](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/group-method/llms-full.txt) | Group drawings in the same sheet. |
| [remove](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/remove-method/llms-full.txt) | Remove a drawing handle or ID, including its group if applicable. |

### Examples

Use a fresh workbook. Create and format the sample data, apply this API and retain the returned document or result in your application. In the browser pass editor.workbook; in Node.js pass the server control.

```typescript
import type { ServerSheetControl } from '@txtextcontrol/tx-sheet-control-server';

function createDrawingCollectionReport(control: ServerSheetControl) {
    const book = control.workbook;
    const sheet = book.sheets.at(0);
    sheet.cell('A1').setText('October invoice');
    sheet
        .cell('A1')
        .format({
            fontFamily: 'Liberation Sans',
            fontSize: 16,
            bold: true,
            textColor: '#ffffff',
            fillColor: '#163b63',
        });

    sheet.columns.at(0).setWidth({ pixels: 240 });
    sheet.range('B8:B9').setValues([[120], [80]]);
    sheet.cell('B10').setFormula('=SUM(B8:B9)');
    sheet.range('B8:B10').format({ numberFormatCode: '#,##0.00', fontSize: 11 });
    sheet.drawings.addShape({
        type: 'rectangle',
        text: 'Approved',
        anchor: { cell: 'F2' },
        size: { width: 180, height: 60 },
        fill: '#e5eef4',
    });

    return sheet;
}
```

### See Also

- [TypeScript Node.js Server API](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/llms-full.txt)
- [Pictures and Shapes](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/pictures-shapes/llms-full.txt)
- [addBarcode](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/addbarcode-method/llms-full.txt) — Inserts a movable barcode or QR code. Missing source/value reads its anchor cell.

---

## In This Section

- [DrawingCollection.addBarcode Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/addbarcode-method/llms-full.txt): DrawingCollection.addBarcode method in the TX Sheet Control TypeScript API for Node.js, with its syntax and a TypeScript example.
- [DrawingCollection.addPicture Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/addpicture-method/llms-full.txt): DrawingCollection.addPicture method in the TX Sheet Control TypeScript API for Node.js: Insert an embedded picture above cells.
- [DrawingCollection.addShape Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/addshape-method/llms-full.txt): DrawingCollection.addShape method in the TX Sheet Control TypeScript API for Node.js: Insert a shape with friendly preset/anchor/size options.
- [DrawingCollection.align Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/align-method/llms-full.txt): DrawingCollection.align method in the TX Sheet Control TypeScript API for Node.js: Align selected objects/groups against each other.
- [DrawingCollection.at Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/at-method/llms-full.txt): DrawingCollection.at method in the TX Sheet Control TypeScript API for Node.js: Find by zero-based z-order index. Includes the syntax and a TypeScript example.
- [DrawingCollection.count Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/count-property/llms-full.txt): DrawingCollection.count property in the TX Sheet Control TypeScript API for Node.js, with its type number and a TypeScript example.
- [DrawingCollection.get Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/get-method/llms-full.txt): DrawingCollection.get method in the TX Sheet Control TypeScript API for Node.js: Find by exact drawing name; throw when absent or ambiguous.
- [DrawingCollection.getById Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/getbyid-method/llms-full.txt): DrawingCollection.getById method in the TX Sheet Control TypeScript API for Node.js: Find by drawing identity. Includes the syntax and a TypeScript example.
- [DrawingCollection.group Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/group-method/llms-full.txt): DrawingCollection.group method in the Node.js TypeScript API: Group drawings in the same sheet. Includes the syntax and a TypeScript example.
- [DrawingCollection.remove Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/remove-method/llms-full.txt): DrawingCollection.remove method in the TX Sheet Control TypeScript API for Node.js: Remove a drawing handle or ID, including its group if applicable.
- [DrawingCollection.sheet Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/sheet-property/llms-full.txt): DrawingCollection.sheet property in the TX Sheet Control TypeScript API for Node.js, with its type Worksheet and a TypeScript example.

---

## Nearby

- **Previous:** [DocumentProperties.version Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/documentproperties/version-property/llms-full.txt)
- **Next:** [DrawingCollection.addPicture Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/drawingcollection/addpicture-method/llms-full.txt)
