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.
garment_id = BwApi.GarmentId()
colorway_ids = BwApi.GarmentColorwayIds(garment_id)
BwApiString* garmentId;
BwApiGarmentId(garmentId);
BwApiVectorInt* colorwayIds = new BwApiVectorInt();
BwApiGarmentColorwayIds(BwApiStringGet(garmentId), colorwayIds);
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.
# assuming the colorway_id is a valid colorway id
materials_in_use = BwApi.ColorwayUsedMaterialIds(garment_id, colorway_id)
BwApiColorwayUsedMaterialIds(garmentId, colorwayId);
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.
colors_in_use = BwApi.ColorwayColorsInUseGet(garment_id, colorway_id)
BwApiColorwayColorsInUseGet(garmentId, colorwayId);
BwApi.ColorwayColorsInUseGet(garmentId, colorwayId);