Line
This file contains the line functionality you can create new iron / puffy /fold etc... line and more.
BwApiLineCreateAsPolyline
Creates a new internal line (base size).
Python
BwApi.LineCreateAsPolyline(garmentId, shapeId, lineProperties, optimized, vecPoints)
C++
BwApiLineCreateAsPolyline(garmentId, shapeId, lineProperties, optimized, vecPoints, newInternalLineId);
C#
BwApi.LineCreateAsPolyline(garmentId, shapeId, lineProperties, optimized, vecPoints);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | lineProperties | JSON object as string that represent a line object (see line_properties.json schema). |
In | optimized | Boolean (1/0) if the creation of the edge should optimized the number of the points. |
In | vecPoints | Array of points that represent the line. |
Out | newInternalLineId | The newly created internal line ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLineCreateAsBezier
Creates a new internal line with Bezier points (base size).
Python
BwApi.LineCreateAsBezier(garmentId, shapeId, lineProperties, points)
C++
BwApiLineCreateAsBezier(garmentId, shapeId, lineProperties, points, newInternalLineId);
C#
BwApi.LineCreateAsBezier(garmentId, shapeId, lineProperties, points);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | lineProperties | JSON object as string that represent a line object (see line_properties.json schema). |
In | points | Array of BwApiBezierPoint that represent the internal line's points. |
Out | newInternalLineId | ID of the newly created internal line ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLineDelete
Delete a line.
Python
BwApi.LineDelete(garmentId, shapeId, cross, lineId)
C++
BwApiLineDelete(garmentId, shapeId, cross, lineId);
C#
BwApi.LineDelete(garmentId, shapeId, cross, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | The line ID to delete. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLinePointsGet
Get a line's points (current size).
Python
BwApi.LinePointsGet(garmentId, shapeId, cross, lineId)
C++
BwApiLinePointsGet(garmentId, shapeId, cross, lineId, linePoints);
C#
BwApi.LinePointsGet(garmentId, shapeId, cross, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | The line ID to get the points from. |
Out | linePoints | Array of line points (see BwApiVectorPoint). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLinePointsGetAsBezier
Get a line's points as Bezier (current size).
Python
BwApi.LinePointsGetAsBezier(garmentId, shapeId, cross, lineId, linePoints)
C++
BwApiLinePointsGetAsBezier(garmentId, shapeId, cross, lineId, linePoints);
C#
BwApi.LinePointsGetAsBezier(garmentId, shapeId, cross, lineId, linePoints);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | The line ID to get the points from. |
In | linePoints | Array of line points (see BwApiVectorBezierPoint). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLinePointsSetAsPolyline
Set a line's points (base size).
Python
BwApi.LinePointsSetAsPolyline(garmentId, shapeId, cross, lineId, optimized, linePoints)
C++
BwApiLinePointsSetAsPolyline(garmentId, shapeId, cross, lineId, optimized, linePoints);
C#
BwApi.LinePointsSetAsPolyline(garmentId, shapeId, cross, lineId, optimized, linePoints);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | The line ID to get the points from. |
In | optimized | Boolean (1/0) if the creation of the edge should optimized the number of the points. |
In | linePoints | Array of line points (see BwApiVectorPoint). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLinePointsSetAsBezier
Set an edge's points as Bezier (base size).
Python
BwApi.LinePointsSetAsBezier(garmentId, shapeId, cross, lineId)
C++
BwApiLinePointsSetAsBezier(garmentId, shapeId, cross, lineId, points);
C#
BwApi.LinePointsSetAsBezier(garmentId, shapeId, cross, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing edge ID. |
Out | points | Array of BwApiBezierPoint that represent the points for this line. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLinePropertiesGet
Get a line's properties.
Python
BwApi.LinePropertiesGet(garmentId, shapeId, cross, lineId)
C++
BwApiLinePropertiesGet(garmentId, shapeId, cross, lineId, lineProperties);
C#
BwApi.LinePropertiesGet(garmentId, shapeId, cross, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
Out | lineProperties | JSON object as string that represent a line object (see line_properties.json schema). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLinePropertiesSet
Set a line's properties.
Python
BwApi.LinePropertiesSet(garmentId, shapeId, cross, lineId, lineProperties)
C++
BwApiLinePropertiesSet(garmentId, shapeId, cross, lineId, lineProperties);
C#
BwApi.LinePropertiesSet(garmentId, shapeId, cross, lineId, lineProperties);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
In | lineProperties | JSON object as string that represent a line object (see line_properties.json schema). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLineMaterialIdGet
Get a line's seam material ID.
Python
BwApi.LineMaterialIdGet(garmentId, shapeId, cross, lineId)
C++
BwApiLineMaterialIdGet(garmentId, shapeId, cross, lineId, materialId);
C#
BwApi.LineMaterialIdGet(garmentId, shapeId, cross, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
Out | materialId | Get the assigned material (seam) ID, -1 if no material assigned. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: Each line can have a material (seam) assigned to it.
---
BwApiLineMaterialIdSet
Set a line's seam material ID.
Python
BwApi.LineMaterialIdSet(garmentId, shapeId, cross, lineId, materialId)
C++
BwApiLineMaterialIdSet(garmentId, shapeId, cross, lineId, materialId);
C#
BwApi.LineMaterialIdSet(garmentId, shapeId, cross, lineId, materialId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
In | materialId | Assign material (seam) ID to this line. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: Each line can have a material (seam) assigned to it.
---
BwApiLineLengthGet
Get a line's length.
Python
BwApi.LineLengthGet(garmentId, shapeId, cross, lineId, sizeId)
C++
BwApiLineLengthGet(garmentId, shapeId, cross, lineId, sizeId, length);
C#
BwApi.LineLengthGet(garmentId, shapeId, cross, lineId, sizeId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
In | sizeId | Size of the garment. |
Out | length | Get the length of the line. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: In the case of cross lines the shape ID is ignored.
---
BwApiInternalLineMirroredIdGet
Get an internal line's mirrored line ID.
Python
BwApi.InternalLineMirroredIdGet(garmentId, shapeId, internalLineId)
C++
BwApiInternalLineMirroredIdGet(garmentId, shapeId, internalLineId, mirroredInternalLineId);
C#
BwApi.InternalLineMirroredIdGet(garmentId, shapeId, internalLineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | internalLineId | Existing edge ID. |
Out | mirroredInternalLineId | Internal line ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: This function is only relevant on inner symmetry shapes.
---
BwApiInternalLineAdjustEdges
Adjust a line's edges to the shape contour.
Python
BwApi.InternalLineAdjustEdges(garmentId, shapeId, internalLineId)
C++
BwApiInternalLineAdjustEdges(garmentId, shapeId, internalLineId);
C#
BwApi.InternalLineAdjustEdges(garmentId, shapeId, internalLineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | internalLineId | Existing edge ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: This function is only relevant for internal lines.
---
BwApiInternalLineConvertToEdge
Converts internal line's to edge's.
Python
BwApi.InternalLineConvertToEdge(garmentId, shapeId, internalLinesIds)
C++
BwApiInternalLineConvertToEdge(garmentId, shapeId, internalLinesIds);
C#
BwApi.InternalLineConvertToEdge(garmentId, shapeId, internalLinesIds);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | internalLinesIds | List of internal lines IDs. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: This function is only relevant for internal lines.
---
BwApiLineMarkerGet
Get an approximate line's marker from a given point.
Python
BwApi.LineMarkerGet(garmentId, shapeId, cross, lineId, point)
C++
BwApiLineMarkerGet(garmentId, shapeId, cross, lineId, point, marker);
C#
BwApi.LineMarkerGet(garmentId, shapeId, cross, lineId, point);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing ID. |
In | point | The point to approximate from. |
Out | marker | Marker size (From 0% to 100%). |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: The marker size is from the start point of the line.
---
BwApiInternalLineFoldDirectionInvert
Invert the fold direction of an internal line.
Python
BwApi.InternalLineFoldDirectionInvert(garmentId, shapeId, lineId)
C++
BwApiInternalLineFoldDirectionInvert(garmentId, shapeId, lineId);
C#
BwApi.InternalLineFoldDirectionInvert(garmentId, shapeId, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | lineId | Existing internal ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLineNameGet
Get a line's name.
Python
BwApi.LineNameGet(garmentId, shapeId, cross, lineId)
C++
BwApiLineNameGet(garmentId, shapeId, cross, lineId, lineName);
C#
BwApi.LineNameGet(garmentId, shapeId, cross, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing lineid. |
Out | lineName | Get the line's name. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLineNameSet
Set a line's name.
Python
BwApi.LineNameSet(garmentId, shapeId, cross, lineId, lineName)
C++
BwApiLineNameSet(garmentId, shapeId, cross, lineId, lineName);
C#
BwApi.LineNameSet(garmentId, shapeId, cross, lineId, lineName);
Parameters
Param | Variable | Description |
In | garmentId | existing garment ID. |
In | shapeId | existing shape ID. |
In | cross | boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | existing line ID. |
In | lineName | set the line's name. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLineCross
Cross/uncross a line.
Python
BwApi.LineCross(garmentId, shapeId, cross, lineId)
C++
BwApiLineCross(garmentId, shapeId, cross, lineId, lineIds);
C#
BwApi.LineCross(garmentId, shapeId, cross, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
Out | lineIds | Array of int containing the line IDs. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: When uncross a design line multiple internal lines may be create.
---
BwApiLineClosed
Check if line is open(0) or closed(1).
Python
BwApi.LineClosed(garmentId, shapeId, cross, lineId)
C++
BwApiLineClosed(garmentId, shapeId, cross, lineId, closed);
C#
BwApi.LineClosed(garmentId, shapeId, cross, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
Out | closed | 0 - the line is not closed, 1 - the line is closed. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLineLockGet
Check if line is locked or not.
Python
BwApi.LineLockGet(garmentId, shapeId, cross, lineId)
C++
BwApiLineLockGet(garmentId, shapeId, cross, lineId, lock);
C#
BwApi.LineLockGet(garmentId, shapeId, cross, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
Out | lock | 1 - line is locked, 0 - not locked. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLineLockSet
Lock(1) or unlock(0) line.
Python
BwApi.LineLockSet(garmentId, shapeId, cross, lineId, lock)
C++
BwApiLineLockSet(garmentId, shapeId, cross, lineId, lock);
C#
BwApi.LineLockSet(garmentId, shapeId, cross, lineId, lock);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
In | lock | 1 - lock the line, 0 - unlock the line. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLineShowIn2DGet
Check if line is visible in 2D window.
Python
BwApi.LineShowIn2DGet(garmentId, shapeId, cross, lineId)
C++
BwApiLineShowIn2DGet(garmentId, shapeId, cross, lineId, show);
C#
BwApi.LineShowIn2DGet(garmentId, shapeId, cross, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
Out | show | 1 - line is visible, 0 - not visible. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLineShowIn2DSet
Show(1) or hide(0) line in 2D window.
Python
BwApi.LineShowIn2DSet(garmentId, shapeId, cross, lineId, show)
C++
BwApiLineShowIn2DSet(garmentId, shapeId, cross, lineId, show);
C#
BwApi.LineShowIn2DSet(garmentId, shapeId, cross, lineId, show);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
In | show | 1 - show the line, 0 - hide the line. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiLineTextureOffsetGet
Get the texture offset of a line.
Python
BwApi.LineTextureOffsetGet(garmentId, shapeId, cross, lineId, materialId)
C++
BwApiLineTextureOffsetGet(garmentId, shapeId, cross, lineId, materialId, offset);
C#
BwApi.LineTextureOffsetGet(garmentId, shapeId, cross, lineId, materialId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
In | materialId | Existing material ID on the shape (this can also be group item in case the texture of the shape is group material). |
Out | offset | Get line's offset. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: The offset is a value from 0 to the length of the line divided by the seam fabric length.
---
BwApiLineTextureOffsetSet
Set the texture offset of a line.
Python
BwApi.LineTextureOffsetSet(garmentId, shapeId, cross, lineId, materialId, offset)
C++
BwApiLineTextureOffsetSet(garmentId, shapeId, cross, lineId, materialId, offset);
C#
BwApi.LineTextureOffsetSet(garmentId, shapeId, cross, lineId, materialId, offset);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
In | materialId | Existing material ID on the shape (this can also be group item in case the texture of the shape is group material). |
In | offset | Line's offset. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: The offset is a value from 0 to the length of the line divided by the seam fabric length.
---
BwApiLineFillMaterialIdGet
Get a line's fill material ID.
Python
BwApi.LineFillMaterialIdGet(garmentId, shapeId, cross, lineId)
C++
BwApiLineFillMaterialIdGet(garmentId, shapeId, cross, lineId, materialId);
C#
BwApi.LineFillMaterialIdGet(garmentId, shapeId, cross, lineId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
Out | materialId | Get the assigned fill material ID, -1 if no material assigned. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: Currently only closed cutmark can have a fill material assigned to it.
---
BwApiLineFillMaterialIdSet
Set a line's fill material ID.
Python
BwApi.LineFillMaterialIdSet(garmentId, shapeId, cross, lineId, materialId)
C++
BwApiLineFillMaterialIdSet(garmentId, shapeId, cross, lineId, materialId);
C#
BwApi.LineFillMaterialIdSet(garmentId, shapeId, cross, lineId, materialId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | shapeId | Existing shape ID. |
In | cross | Boolean (1/0) 0 not cross (internal line), 1 cross (design line). |
In | lineId | Existing line ID. |
In | materialId | Assign fill material ID to this line. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: Currently only closed cutmark can have a fill material assigned to it.
---