Skip to main content

Button

ButtonCreate ButtonDelete ButtonOneLocation Butt...

Updated over 2 months ago

ButtonCreate

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

Python C++ C# VS Server

Python

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

C++

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

C#

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

VS Server

{
	"id": "API processing order number",
	"function": "ButtonCreate",
	"params": {
		"garmentId": "value",
		"materialId": "value",
		"shapeId": "value",
		"holeShapeId": "value",
		"isOneLocation": "value"
	}
}    

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

Error/success code (see BwApiErrorCodes enum).

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

IsOneLocation can be set only in this function. To change it delete and create new a button.

ButtonDelete

Delete a button.

Python C++ C# VS Server

Python

BwApi.ButtonDelete(garmentId, buttonId)

C++

BwApiButtonDelete(garmentId, buttonId);

C#

BwApi.ButtonDelete(garmentId, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonDelete",
	"params": {
		"garmentId": "value",
		"buttonId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

The ID of the button to delete

Error/success code (see BwApiErrorCodes enum).

ButtonOneLocation

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

Python C++ C# VS Server

Python

BwApi.ButtonOneLocation(garmentId, buttonId)

C++

BwApiButtonOneLocation(garmentId, buttonId);

C#

BwApi.ButtonOneLocation(garmentId, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonOneLocation",
	"params": {
		"garmentId": "value",
		"buttonId": "value"
	}
}    

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

Error/success code (see BwApiErrorCodes enum).

ButtonButtonedGet

Get a button buttoned state.

Python C++ C# VS Server

Python

BwApi.ButtonButtonedGet(garmentId, buttonId)

C++

BwApiButtonButtonedGet(garmentId, buttonId);

C#

BwApi.ButtonButtonedGet(garmentId, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonButtonedGet",
	"params": {
		"garmentId": "value",
		"buttonId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

Out

buttoned

The button buttoned state

Error/success code (see BwApiErrorCodes enum).

ButtonButtonedSet

Set a button's buttoned state.

Python C++ C# VS Server

Python

BwApi.ButtonButtonedSet(garmentId, buttonId, buttoned)

C++

BwApiButtonButtonedSet(garmentId, buttonId, buttoned);

C#

BwApi.ButtonButtonedSet(garmentId, buttonId, buttoned);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonButtonedSet",
	"params": {
		"garmentId": "value",
		"buttonId": "value",
		"buttoned": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

In

buttoned

The button buttoned state

Error/success code (see BwApiErrorCodes enum).

ButtonPositionInvert

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

Python C++ C# VS Server

Python

BwApi.ButtonPositionInvert(garmentId, buttonId)

C++

BwApiButtonPositionInvert(garmentId, buttonId);

C#

BwApi.ButtonPositionInvert(garmentId, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonPositionInvert",
	"params": {
		"garmentId": "value",
		"buttonId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

Error/success code (see BwApiErrorCodes enum).

ButtonInsideGet

Get a button inside state.

Python C++ C# VS Server

Python

BwApi.ButtonInsideGet(garmentId, buttonId)

C++

BwApiButtonInsideGet(garmentId, buttonId);

C#

BwApi.ButtonInsideGet(garmentId, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonInsideGet",
	"params": {
		"garmentId": "value",
		"buttonId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

Out

inside

The button inside state

Error/success code (see BwApiErrorCodes enum).

ButtonInsideSet

Set a button inside state.

Python C++ C# VS Server

Python

BwApi.ButtonInsideSet(garmentId, buttonId, inside)

C++

BwApiButtonInsideSet(garmentId, buttonId, inside);

C#

BwApi.ButtonInsideSet(garmentId, buttonId, inside);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonInsideSet",
	"params": {
		"garmentId": "value",
		"buttonId": "value",
		"inside": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

In

inside

The button inside state

Error/success code (see BwApiErrorCodes enum).

ButtonVisibleSizeIdsGet

Get a list of sizes where the button is visible.

Python C++ C# VS Server

Python

BwApi.ButtonVisibleSizeIdsGet(garmentId, buttonId)

C++

BwApiButtonVisibleSizeIdsGet(garmentId, buttonId);

C#

BwApi.ButtonVisibleSizeIdsGet(garmentId, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonVisibleSizeIdsGet",
	"params": {
		"garmentId": "value",
		"buttonId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

Out

sizesIds

List of sizes

Error/success code (see BwApiErrorCodes enum).

ButtonVisibleSizeIdsSet

Set the sizes where the button will be visible.

Python C++ C# VS Server

Python

BwApi.ButtonVisibleSizeIdsSet(garmentId, buttonId, sizeIds)

C++

BwApiButtonVisibleSizeIdsSet(garmentId, buttonId, sizeIds);

C#

BwApi.ButtonVisibleSizeIdsSet(garmentId, buttonId, sizeIds);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonVisibleSizeIdsSet",
	"params": {
		"garmentId": "value",
		"buttonId": "value",
		"sizeIds": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

In

sizeIds

List of sizes

Error/success code (see BwApiErrorCodes enum).

Ignore invalid sizeId.

ButtonPositionGet

Get the position of a button/buttonhole.

Python C++ C# VS Server

Python

BwApi.ButtonPositionGet(garmentId, onButton, buttonId)

C++

BwApiButtonPositionGet(garmentId, onButton, buttonId);

C#

BwApi.ButtonPositionGet(garmentId, onButton, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonPositionGet",
	"params": {
		"garmentId": "value",
		"onButton": "value",
		"buttonId": "value"
	}
}    

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

Error/success code (see BwApiErrorCodes enum).

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

ButtonPositionSet

Set the position of a button/buttonhole.

Python C++ C# VS Server

Python

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

C++

BwApiButtonPositionSet(garmentId, onButton, buttonId, offset);

C#

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

VS Server

{
	"id": "API processing order number",
	"function": "ButtonPositionSet",
	"params": {
		"garmentId": "value",
		"onButton": "value",
		"buttonId": "value",
		"offset": "value"
	}
}    

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

Error/success code (see BwApiErrorCodes enum).

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

ButtonRotateGet

Get the rotation angle of a button/buttonhole.

Python C++ C# VS Server

Python

BwApi.ButtonRotateGet(garmentId, onButton, buttonId)

C++

BwApiButtonRotateGet(garmentId, onButton, buttonId);

C#

BwApi.ButtonRotateGet(garmentId, onButton, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonRotateGet",
	"params": {
		"garmentId": "value",
		"onButton": "value",
		"buttonId": "value"
	}
}    

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

Error/success code (see BwApiErrorCodes enum).

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

ButtonRotateSet

Set the rotation angle of a button/buttonhole.

Python C++ C# VS Server

Python

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

C++

BwApiButtonRotateSet(garmentId, onButton, buttonId, rotate);

C#

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

VS Server

{
	"id": "API processing order number",
	"function": "ButtonRotateSet",
	"params": {
		"garmentId": "value",
		"onButton": "value",
		"buttonId": "value",
		"rotate": "value"
	}
}    

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

Error/success code (see BwApiErrorCodes enum).

ButtonWidthGet

Get the width of the buttonhole.

Python C++ C# VS Server

Python

BwApi.ButtonWidthGet(garmentId, buttonId)

C++

BwApiButtonWidthGet(garmentId, buttonId);

C#

BwApi.ButtonWidthGet(garmentId, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonWidthGet",
	"params": {
		"garmentId": "value",
		"buttonId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

Out

width

Width of the buttonhole

Error/success code (see BwApiErrorCodes enum).

ButtonWidthSet

Set the width of a buttonhole.

Python C++ C# VS Server

Python

BwApi.ButtonWidthSet(garmentId, buttonId, width)

C++

BwApiButtonWidthSet(garmentId, buttonId, width);

C#

BwApi.ButtonWidthSet(garmentId, buttonId, width);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonWidthSet",
	"params": {
		"garmentId": "value",
		"buttonId": "value",
		"width": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

In

width

Width of the buttonhole

Error/success code (see BwApiErrorCodes enum).

ButtonHeightGet

Get the height of a buttonhole.

Python C++ C# VS Server

Python

BwApi.ButtonHeightGet(garmentId, buttonId)

C++

BwApiButtonHeightGet(garmentId, buttonId);

C#

BwApi.ButtonHeightGet(garmentId, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonHeightGet",
	"params": {
		"garmentId": "value",
		"buttonId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

Out

height

Height of the buttonhole

Error/success code (see BwApiErrorCodes enum).

ButtonHeightSet

Set the height of a buttonhole.

Python C++ C# VS Server

Python

BwApi.ButtonHeightSet(garmentId, buttonId, height)

C++

BwApiButtonHeightSet(garmentId, buttonId, height);

C#

BwApi.ButtonHeightSet(garmentId, buttonId, height);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonHeightSet",
	"params": {
		"garmentId": "value",
		"buttonId": "value",
		"height": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

In

height

Height of the buttonhole

Error/success code (see BwApiErrorCodes enum).

ButtonClone

Clone an exiting button.

Python C++ C# VS Server

Python

BwApi.ButtonClone(garmentId, buttonId)

C++

BwApiButtonClone(garmentId, buttonId);

C#

BwApi.ButtonClone(garmentId, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonClone",
	"params": {
		"garmentId": "value",
		"buttonId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

Out

cloneButtonId

Cloned button ID

Error/success code (see BwApiErrorCodes enum).

ButtonConnectedShapes

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

Python C++ C# VS Server

Python

BwApi.ButtonConnectedShapes(garmentId, buttonId)

C++

BwApiButtonConnectedShapes(garmentId, buttonId);

C#

BwApi.ButtonConnectedShapes(garmentId, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonConnectedShapes",
	"params": {
		"garmentId": "value",
		"buttonId": "value"
	}
}    

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

Error/success code (see BwApiErrorCodes enum).

ButtonMaterialIdGet

Get the group material ID assigned to a button.

Python C++ C# VS Server

Python

BwApi.ButtonMaterialIdGet(garmentId, buttonId)

C++

BwApiButtonMaterialIdGet(garmentId, buttonId);

C#

BwApi.ButtonMaterialIdGet(garmentId, buttonId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonMaterialIdGet",
	"params": {
		"garmentId": "value",
		"buttonId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

Out

materialId

Get the assigned material ID

Error/success code (see BwApiErrorCodes enum).

The material is from the current colorway.

ButtonMaterialIdSet

Assign group material ID to the button.

Python C++ C# VS Server

Python

BwApi.ButtonMaterialIdSet(garmentId, buttonId, materialId)

C++

BwApiButtonMaterialIdSet(garmentId, buttonId, materialId);

C#

BwApi.ButtonMaterialIdSet(garmentId, buttonId, materialId);

VS Server

{
	"id": "API processing order number",
	"function": "ButtonMaterialIdSet",
	"params": {
		"garmentId": "value",
		"buttonId": "value",
		"materialId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

buttonId

Existing button ID

In

materialId

Material ID to assign

Error/success code (see BwApiErrorCodes enum).

The material is from the current colorway.

ButtonGradeIdGet

Get grade ID assigned to a button/button hole.

Python C++ C#

Python

BwApi.ButtonGradeIdGet(garmentId, buttonId, isButton)

C++

BwApiButtonGradeIdGet(garmentId, buttonId, isButton);

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

Error/success code (see BwApiErrorCodes enum).

Grade ID is from a grading table.

ButtonGradeIdSet

Assign grade ID to a button/button hole.

Python C++ C#

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

Error/success code (see BwApiErrorCodes enum).

Grade ID is from a grading table.

Did this answer your question?