Skip to main content

Ruler

Ruler

This file contains rulers functionality.

BwApiRulerIds

Get a list of all ruler IDs.

Python

BwApi.RulerIds(garmentId)

C++

BwApiRulerIds(garmentId, rulerIds);

C#

BwApi.RulerIds(garmentId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

Out

rulerIds

List of all ruler IDs (see BwApiVectorInt type).

Returns: Error/success code (see BwApiErrorCodes enum).

---

BwApiRulerCreate

Create a new ruler between elements.

Python

BwApi.RulerCreate(garmentId, name, elements)

C++

BwApiRulerCreate(garmentId, name, elements, rulerId);

C#

BwApi.RulerCreate(garmentId, name, elements);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

name

Ruler name.

In

elements

Array of elements.

Out

rulerId

The ID of the newly created ruler.

Returns: Error/success code (see BwApiErrorCodes enum).

---

BwApiRulerNameGet

Get a ruler's name.

Python

BwApi.RulerNameGet(garmentId, rulerId)

C++

BwApiRulerNameGet(garmentId, rulerId, name);

C#

BwApi.RulerNameGet(garmentId, rulerId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

rulerId

Existing ruler ID.

Out

name

Ruler name.

Returns: Error/success code (see BwApiErrorCodes enum).

---

BwApiRulerLengthGet

Get the length of a rule for a given size.

Python

BwApi.RulerLengthGet(garmentId, rulerId, sizeId)

C++

BwApiRulerLengthGet(garmentId, rulerId, sizeId, length);

C#

BwApi.RulerLengthGet(garmentId, rulerId, sizeId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

rulerId

Existing ruler ID.

In

sizeId

Existing size ID (see BwApiGarmentSizeIds and BwApiSizeCurrentGet you can also pass -1 for current size).

Out

length

Ruler's total length.

Returns: Error/success code (see BwApiErrorCodes enum).

---

BwApiRuler3DLengthGet

Get the 3D length for the given ruler ID and size ID.

Python

BwApi.Ruler3DLengthGet(garmentId, rulerId, sizeId)

C++

BwApiRuler3DLengthGet(garmentId, rulerId, sizeId, length);

C#

BwApi.Ruler3DLengthGet(garmentId, rulerId, sizeId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

rulerId

Existing ruler ID.

In

sizeId

Existing size ID (see BwApiGarmentSizeIds and BwApiSizeCurrentGet you can also pass - 1 for current size).

Out

length

Ruler's total length if exist otherwise -1.

Returns: Error/success code (see BwApiErrorCodes enum).

Note: The 3D length is available when a snapshot exists.

---

Did this answer your question?