Costing
Costing is how you may get information of consumption of materials and calculate the cost of the garment. Use the Cost API to get, update cost and so on.
To learn more about the rest of the API, please refer to GarmentCost in the repository.
Sample Plugin
Sample plugin for costing is available here
Get Surface Area of Material in Use
Code Snippet
Python C++ C#
Python
BwApi.MaterialSurfaceAreaGet(garmentId, colorwayId, materialId, sizeId)
C++
float area; BwApiMaterialSurfaceAreaGet( garmentId, colorwayId, materialId, sizeId, &area);
C#
float area; BwApi.MaterialSurfaceAreaGet(garmentId, colorwayId, materialId, sizeId, out area);
Result
The surface area of a material.
Get length of Material in Use
Code Snippet
Python C++ C#
Python
# get an existing material length and depth (works only on lines and seams) length, depth = BwApi.MaterialLengthGet(garmentId, colorwayId, materialId, sizeId)
C++
// get an existing material length and depth (works only on lines and seams) float length; float depth; BwApiMaterialLengthGet( garmentId, colorwayId, materialId, sizeId, &length, &depth);
C#
// get an existing material length and depth (works only on lines and seams) float length; float depth; BwApi.MaterialLengthGet(garmentId, colorwayId, materialId, sizeId, out length, out depth);
Result
The length and depth of a material.