Skip to main content

Button

Button

This file contains the button functionality you can modify an existing button.

BwApiButtonCreate

Create a new button and assign it to the given shape.

Python

BwApi.ButtonCreate(garmentId, materialId, shapeId, holeShapeId, isOneLocation)

C++

BwApiButtonCreate(garmentId, materialId, shapeId, holeShapeId, isOneLocation, buttonId);

C#

BwApi.ButtonCreate(garmentId, materialId, shapeId, holeShapeId, isOneLocation);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

materialId

Existing material ID.

In

shapeId

Assign the button to this shape.

In

holeShapeId

Assign the buttonhole to this shape.

In

isOneLocation

Boolean (1/0) if the button and buttonhole are assigned to one location (fixed in one place).

Out

buttonId

The ID of the new button.

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

Note: The new button will be located in the center of the shape. Call BwApiButtonPositionSet() to change the initial position.

---

BwApiButtonDelete

Delete a button.

Python

BwApi.ButtonDelete(garmentId, buttonId)

C++

BwApiButtonDelete(garmentId, buttonId);

C#

BwApi.ButtonDelete(garmentId, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

The ID of the button to delete.

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

---

BwApiButtonOneLocation

Check if the button is one location (ie. the button and button hole on the same location) or not.

Python

BwApi.ButtonOneLocation(garmentId, buttonId)

C++

BwApiButtonOneLocation(garmentId, buttonId, oneLocation);

C#

BwApi.ButtonOneLocation(garmentId, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

Out

oneLocation

Boolean (1/0) if the given button ID is one location or not.

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

---

BwApiButtonButtonedGet

Get a button buttoned state.

Python

BwApi.ButtonButtonedGet(garmentId, buttonId)

C++

BwApiButtonButtonedGet(garmentId, buttonId, buttoned);

C#

BwApi.ButtonButtonedGet(garmentId, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

Out

buttoned

The button buttoned state.

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

---

BwApiButtonButtonedSet

Set a button's buttoned state.

Python

BwApi.ButtonButtonedSet(garmentId, buttonId, buttoned)

C++

BwApiButtonButtonedSet(garmentId, buttonId, buttoned);

C#

BwApi.ButtonButtonedSet(garmentId, buttonId, buttoned);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

In

buttoned

The button buttoned state.

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

---

BwApiButtonPositionInvert

Invert the button position (swap the rules of button and button hole).

Python

BwApi.ButtonPositionInvert(garmentId, buttonId)

C++

BwApiButtonPositionInvert(garmentId, buttonId);

C#

BwApi.ButtonPositionInvert(garmentId, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

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

---

BwApiButtonInsideGet

Get a button inside state.

Python

BwApi.ButtonInsideGet(garmentId, buttonId)

C++

BwApiButtonInsideGet(garmentId, buttonId, inside);

C#

BwApi.ButtonInsideGet(garmentId, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

Out

inside

The button inside state.

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

---

BwApiButtonInsideSet

Set a button inside state.

Python

BwApi.ButtonInsideSet(garmentId, buttonId, inside)

C++

BwApiButtonInsideSet(garmentId, buttonId, inside);

C#

BwApi.ButtonInsideSet(garmentId, buttonId, inside);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

In

inside

The button inside state.

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

---

BwApiButtonVisibleSizeIdsGet

Get a list of sizes where the button is visible.

Python

BwApi.ButtonVisibleSizeIdsGet(garmentId, buttonId)

C++

BwApiButtonVisibleSizeIdsGet(garmentId, buttonId, sizesIds);

C#

BwApi.ButtonVisibleSizeIdsGet(garmentId, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

Out

sizesIds

List of sizes.

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

---

BwApiButtonVisibleSizeIdsSet

Set the sizes where the button will be visible.

Python

BwApi.ButtonVisibleSizeIdsSet(garmentId, buttonId, sizeIds)

C++

BwApiButtonVisibleSizeIdsSet(garmentId, buttonId, sizeIds);

C#

BwApi.ButtonVisibleSizeIdsSet(garmentId, buttonId, sizeIds);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

In

sizeIds

List of sizes.

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

Note: Ignore invalid sizeId.

---

BwApiButtonPositionGet

Get the position of a button/buttonhole.

Python

BwApi.ButtonPositionGet(garmentId, onButton, buttonId)

C++

BwApiButtonPositionGet(garmentId, onButton, buttonId, offset);

C#

BwApi.ButtonPositionGet(garmentId, onButton, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

onButton

Boolean (1/0) if the operation is on the button or not.

In

buttonId

Existing button ID.

Out

offset

Offset on the button/buttonhole.

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

Note: If the button is one location then the onButton parameter is redundant.

---

BwApiButtonPositionSet

Set the position of a button/buttonhole.

Python

BwApi.ButtonPositionSet(garmentId, onButton, buttonId, offset)

C++

BwApiButtonPositionSet(garmentId, onButton, buttonId, offset);

C#

BwApi.ButtonPositionSet(garmentId, onButton, buttonId, offset);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

onButton

Boolean (1/0) if the operation is on the button or not.

In

buttonId

Existing button ID.

In

offset

Offset on the button/buttonhole.

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

Note: If the button is one location then the onButton parameter is redundant.

---

BwApiButtonRotateGet

Get the rotation angle of a button/buttonhole.

Python

BwApi.ButtonRotateGet(garmentId, onButton, buttonId)

C++

BwApiButtonRotateGet(garmentId, onButton, buttonId, rotate);

C#

BwApi.ButtonRotateGet(garmentId, onButton, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

onButton

Boolean (1/0) if the operation is on the button or not.

In

buttonId

Existing button ID.

Out

rotate

Rotation on the button/buttonhole.

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

Note: If the button is one location then the onButton parameter is redundant.

---

BwApiButtonRotateSet

Set the rotation angle of a button/buttonhole.

Python

BwApi.ButtonRotateSet(garmentId, onButton, buttonId, rotate)

C++

BwApiButtonRotateSet(garmentId, onButton, buttonId, rotate);

C#

BwApi.ButtonRotateSet(garmentId, onButton, buttonId, rotate);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

onButton

Boolean (1/0) if the operation is on the button or not.

In

buttonId

Existing button ID.

In

rotate

Offset on the button/buttonhole.

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

---

BwApiButtonWidthGet

Get the width of the buttonhole.

Python

BwApi.ButtonWidthGet(garmentId, buttonId)

C++

BwApiButtonWidthGet(garmentId, buttonId, width);

C#

BwApi.ButtonWidthGet(garmentId, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

Out

width

Width of the buttonhole.

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

---

BwApiButtonWidthSet

Set the width of a buttonhole.

Python

BwApi.ButtonWidthSet(garmentId, buttonId, width)

C++

BwApiButtonWidthSet(garmentId, buttonId, width);

C#

BwApi.ButtonWidthSet(garmentId, buttonId, width);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

In

width

Width of the buttonhole.

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

---

BwApiButtonHeightGet

Get the height of a buttonhole.

Python

BwApi.ButtonHeightGet(garmentId, buttonId)

C++

BwApiButtonHeightGet(garmentId, buttonId, height);

C#

BwApi.ButtonHeightGet(garmentId, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

Out

height

Height of the buttonhole.

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

---

BwApiButtonHeightSet

Set the height of a buttonhole.

Python

BwApi.ButtonHeightSet(garmentId, buttonId, height)

C++

BwApiButtonHeightSet(garmentId, buttonId, height);

C#

BwApi.ButtonHeightSet(garmentId, buttonId, height);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

In

height

Height of the buttonhole.

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

---

BwApiButtonClone

Clone an exiting button.

Python

BwApi.ButtonClone(garmentId, buttonId)

C++

BwApiButtonClone(garmentId, buttonId, cloneButtonId);

C#

BwApi.ButtonClone(garmentId, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

Out

cloneButtonId

Cloned button ID.

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

---

BwApiButtonConnectedShapes

Gets the ID of the shapes to which the button pieces are connected.

Python

BwApi.ButtonConnectedShapes(garmentId, buttonId)

C++

BwApiButtonConnectedShapes(garmentId, buttonId, buttonShapeId, buttonHoleShapeId);

C#

BwApi.ButtonConnectedShapes(garmentId, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

Out

buttonShapeId

The ID of the shape to which the button is connected, returns -1 if no such shape exists.

Out

buttonHoleShapeId

The ID of the shape to which the buttonhole is connected, returns -1 if no such shape exists.

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

---

BwApiButtonMaterialIdGet

Get the group material ID assigned to a button.

Python

BwApi.ButtonMaterialIdGet(garmentId, buttonId)

C++

BwApiButtonMaterialIdGet(garmentId, buttonId, materialId);

C#

BwApi.ButtonMaterialIdGet(garmentId, buttonId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

Out

materialId

Get the assigned material ID.

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

Note: The material is from the current colorway.

---

BwApiButtonMaterialIdSet

Assign group material ID to the button.

Python

BwApi.ButtonMaterialIdSet(garmentId, buttonId, materialId)

C++

BwApiButtonMaterialIdSet(garmentId, buttonId, materialId);

C#

BwApi.ButtonMaterialIdSet(garmentId, buttonId, materialId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

In

materialId

Material ID to assign.

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

Note: The material is from the current colorway.

---

BwApiButtonGradeIdGet

Get grade ID assigned to a button/button hole.

Python

BwApi.ButtonGradeIdGet(garmentId, buttonId, isButton)

C++

BwApiButtonGradeIdGet(garmentId, buttonId, isButton, gradeId);

C#

BwApi.ButtonGradeIdGet(garmentId, buttonId, isButton);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

In

isButton

Called for button or button hole.

Out

gradeId

Get the assigned grade ID.

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

Note: Grade ID is from a grading table.

---

BwApiButtonGradeIdSet

Assign grade ID to a button/button hole.

Python

BwApi.ButtonGradeIdSet(garmentId, buttonId, isButton, gradeId)

C++

BwApiButtonGradeIdSet(garmentId, buttonId, isButton, gradeId);

C#

BwApi.ButtonGradeIdSet(garmentId, buttonId, isButton, gradeId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

buttonId

Existing button ID.

In

isButton

Called for button or button hole.

In

gradeId

Grade ID to assign.

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

Note: Grade ID is from a grading table.

---

Did this answer your question?