Skip to main content

Bill of Material

Bill of Materials Getting Colorway IDs Getting Materials in Use Getting Colors in Use Bill of Material Bill of Material is how you ob...

Updated over 2 months ago

Bill of Material

Bill of Material is how you obtain information of materials and colors used in each colorway of the garment. Use the "In Use" API to get the material or color in use.

For more information about the feature, please visit here.

Getting Colorway IDs

Code Snippet

The code snippet below shows how to get the colorway IDs in the garment in the right order.

Python C++ C#

Python

garment_id = BwApi.GarmentId()
colorway_ids = BwApi.GarmentColorwayIds(garment_id)

C++

BwApiString* garmentId;
BwApiGarmentId(garmentId);
BwApiVectorInt* colorwayIds = new BwApiVectorInt();
BwApiGarmentColorwayIds(BwApiStringGet(garmentId), colorwayIds);

C#

string garmentId;
BwApi.GarmentId(out garmentId);
BwApiVectorInt colorwayIds = new BwApiVectorInt();
BwApi.GarmentColorwayIds(garmentId, colorwayIds);

Getting Material in Use

Code Snippet

The code snippet below shows how to get the colors in use in a colorway. The return value from this function is an array of color. Note: color is represented by RGB data.

Python C++ C#

Python

# assuming the colorway_id is a valid colorway id
materials_in_use = BwApi.ColorwayUsedMaterialIds(garment_id, colorway_id)

C++

BwApiColorwayUsedMaterialIds(garmentId, colorwayId);

C#

BwApi.ColorwayUsedMaterialIds(garmentId, colorwayId);

Getting Colors in Use

Code Snippet

The code snippet below shows how to get the colors in use in a colorway. The return value from this function is an array of color. Note: color is represented by RGB data.

Python C++ C#

Python

colors_in_use = BwApi.ColorwayColorsInUseGet(garment_id, colorway_id)

C++

BwApiColorwayColorsInUseGet(garmentId, colorwayId);

C#

BwApi.ColorwayColorsInUseGet(garmentId, colorwayId);
Did this answer your question?