Skip to main content

Shape

ShapeCreate ShapeDelete ShapePropertiesGet Shape...

Updated over 2 months ago

ShapeCreate

Creates a new shape and adds it to the current garment.

Python C++ C# VS Server

Python

BwApi.ShapeCreate(garmentId)

C++

BwApiShapeCreate(garmentId);

C#

BwApi.ShapeCreate(garmentId);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

Out

newShapeId

The ID of the newly created shape

Error/success code (see BwApiErrorCodes enum).

When creating a shape the rotate value is equal to 0 degrees unlike the UI where the value is 90 degrees.

ShapeDelete

Deletes a shape.

Python C++ C# VS Server

Python

BwApi.ShapeDelete(garmentId, shapeId)

C++

BwApiShapeDelete(garmentId, shapeId);

C#

BwApi.ShapeDelete(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeDelete",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

The ID of the shape to delete

Error/success code (see BwApiErrorCodes enum).

Removing the parent shape will delete all its symmetry shapes.

ShapePropertiesGet

Get a shape's properties.

Python C++ C# VS Server

Python

BwApi.ShapePropertiesGet(garmentId, shapeId)

C++

BwApiShapePropertiesGet(garmentId, shapeId);

C#

BwApi.ShapePropertiesGet(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapePropertiesGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

shapeProperties

JSON object as a string that represents a shape object (see Schema/shape_properties.json schema)

Error/success code (see BwApiErrorCodes enum).

ShapePropertiesSet

Set a shape's properties.

Python C++ C# VS Server

Python

BwApi.ShapePropertiesSet(garmentId, shapeId, shapeProperties)

C++

BwApiShapePropertiesSet(garmentId, shapeId, shapeProperties);

C#

BwApi.ShapePropertiesSet(garmentId, shapeId, shapeProperties);

VS Server

{
	"id": "API processing order number",
	"function": "ShapePropertiesSet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"shapeProperties": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

shapeProperties

JSON object as a string that represents a shape object (see Schema/shape_properties.json schema)

Error/success code (see BwApiErrorCodes enum).

ShapeClone

Clone a shape.

Python C++ C# VS Server

Python

BwApi.ShapeClone(garmentId, shapeId)

C++

BwApiShapeClone(garmentId, shapeId);

C#

BwApi.ShapeClone(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeClone",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

The ID of an existing complete shape

Out

newShapeId

The ID of the newly created shape

Error/success code (see BwApiErrorCodes enum).

The source shape must be in a complete state (see BwApiShapeStateGet).

ShapeCloneEx

Clone a shape - extended.

Python C++ C# VS Server

Python

BwApi.ShapeCloneEx(garmentId, shapeId, options)

C++

BwApiShapeCloneEx(garmentId, shapeId, options);

C#

BwApi.ShapeCloneEx(garmentId, shapeId, options);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeCloneEx",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"options": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

The ID of an existing complete shape

In

options

The options to clone the shape (see BwApiCloneShapeOption)

Out

newShapeId

The ID of the newly created shape

Error/success code (see BwApiErrorCodes enum).

The source shape must be in a complete state (see BwApiShapeStateGet).

ShapeNameGet

Get a shape's name.

Python C++ C# VS Server

Python

BwApi.ShapeNameGet(garmentId, shapeId)

C++

BwApiShapeNameGet(garmentId, shapeId);

C#

BwApi.ShapeNameGet(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeNameGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

shapeName

Get the shape's name

Error/success code (see BwApiErrorCodes enum).

ShapeNameSet

Set a shape's name.

Python C++ C# VS Server

Python

BwApi.ShapeNameSet(garmentId, shapeId, shapeName)

C++

BwApiShapeNameSet(garmentId, shapeId, shapeName);

C#

BwApi.ShapeNameSet(garmentId, shapeId, shapeName);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeNameSet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"shapeName": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

shapeName

Set the shape's name

Error/success code (see BwApiErrorCodes enum).

ShapeEdgeIds

Get a shape's edge IDs.

Python C++ C# VS Server

Python

BwApi.ShapeEdgeIds(garmentId, shapeId)

C++

BwApiShapeEdgeIds(garmentId, shapeId);

C#

BwApi.ShapeEdgeIds(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeEdgeIds",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

edgeIds

Array of int containing the edge IDs

Error/success code (see BwApiErrorCodes enum).

ShapePoints

Get a shape's points.

Python C++ C# VS Server

Python

BwApi.ShapePoints(garmentId, shapeId)

C++

BwApiShapePoints(garmentId, shapeId);

C#

BwApi.ShapePoints(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapePoints",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

points

Array of BwApiPoint that represents all the points within the given shape

Error/success code (see BwApiErrorCodes enum).

ShapePointsAsBezier

Get a shape's points as Bezier.

Python C++ C# VS Server

Python

BwApi.ShapePointsAsBezier(garmentId, shapeId)

C++

BwApiShapePointsAsBezier(garmentId, shapeId);

C#

BwApi.ShapePointsAsBezier(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapePointsAsBezier",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

points

Array of BwApiBezierPoint that represents all the points within the given shape

Error/success code (see BwApiErrorCodes enum).

ShapeTransformationGet

Get a shape's transformation properties.

Python C++ C# VS Server

Python

BwApi.ShapeTransformationGet(garmentId, shapeId)

C++

BwApiShapeTransformationGet(garmentId, shapeId);

C#

BwApi.ShapeTransformationGet(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeTransformationGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

transformation

Shape transformation (see BwApiShapeTransformation)

Error/success code (see BwApiErrorCodes enum).

For attachments coordinates depend on the current size of garment and originate from the center of the attachment on the X/Y axis of the parent shape.

ShapeTransformationSet

Set a shape's transformation properties.

Python C++ C# VS Server

Python

BwApi.ShapeTransformationSet(garmentId, shapeId, transformation)

C++

BwApiShapeTransformationSet(garmentId, shapeId, transformation);

C#

BwApi.ShapeTransformationSet(garmentId, shapeId, transformation);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeTransformationSet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"transformation": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

transformation

Shape transformation (see BwApiShapeTransformation)

Error/success code (see BwApiErrorCodes enum).

For attachments coordinates depend on the current size of garment and originate from the center of the attachment on the X/Y axis of the parent shape.

Use BwApiShapeTransformationGet first to get the current values, update the struct and only then call BwApiShapeTransformationSet with the updated struct.

Warning: Breaking change: from api version 3.1 this function will synchronously affect symmetrical shapes so you should set the transformation only on one shape.

ShapeGrainLineAngleGet

Get a shape's grain line angle.

Python C++ C# VS Server

Python

BwApi.ShapeGrainLineAngleGet(garmentId, shapeId)

C++

BwApiShapeGrainLineAngleGet(garmentId, shapeId);

C#

BwApi.ShapeGrainLineAngleGet(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeGrainLineAngleGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

angle

Get the current grain line angle (radians)

Error/success code (see BwApiErrorCodes enum).

ShapeGrainLineAngleSet

Set a shape's grain line angle.

Python C++ C# VS Server

Python

BwApi.ShapeGrainLineAngleSet(garmentId, shapeId)

C++

BwApiShapeGrainLineAngleSet(garmentId, shapeId);

C#

BwApi.ShapeGrainLineAngleSet(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeGrainLineAngleSet",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

angle

Set the grain line angle (radians)

Error/success code (see BwApiErrorCodes enum).

ShapeSymmetryCreate

Create a new symmetry shape.

Python C++ C# VS Server

Python

BwApi.ShapeSymmetryCreate(garmentId, parentShapeId, type, edgeId)

C++

BwApiShapeSymmetryCreate(garmentId, parentShapeId, type, edgeId);

C#

BwApi.ShapeSymmetryCreate(garmentId, parentShapeId, type, edgeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeSymmetryCreate",
	"params": {
		"garmentId": "value",
		"parentShapeId": "value",
		"type": "value",
		"edgeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

parentShapeId

Existing parent shape ID, create symmetry from this shape

In

type

Symmetry type to use (see BwApiShapeSymmetryType)

In

edgeId

Relevant only for inner symmetry (type == BW_API_SHAPE_SYMMETRY_TYPE_INNER), for other symmetry types pass -1 as the edge ID

Out

newSymmetryShapeId

The newly created child(symmetry) shape ID, in case of inner symmetry this value will be the same as parentShapeId upon success

Error/success code (see BwApiErrorCodes enum).

When creating inner symmetry (BW_API_SHAPE_SYMMETRY_TYPE_INNER) the order of the edges will be modified.

ShapeSymmetryCancel

Detach the child (symmetry) shape from its parent.

Python C++ C# VS Server

Python

BwApi.ShapeSymmetryCancel(garmentId, childShapeId)

C++

BwApiShapeSymmetryCancel(garmentId, childShapeId);

C#

BwApi.ShapeSymmetryCancel(garmentId, childShapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeSymmetryCancel",
	"params": {
		"garmentId": "value",
		"childShapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

childShapeId

Existing child(symmetry) shape ID to detach from his parent

Error/success code (see BwApiErrorCodes enum).

This will convert symmetry shape to regular shape.

ShapeInnerSymmetryCancel

Cancel an inner symmetry (only for parent shape).

Python C++ C# VS Server

Python

BwApi.ShapeInnerSymmetryCancel(garmentId, shapeId, keepBoth)

C++

BwApiShapeInnerSymmetryCancel(garmentId, shapeId, keepBoth);

C#

BwApi.ShapeInnerSymmetryCancel(garmentId, shapeId, keepBoth);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeInnerSymmetryCancel",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"keepBoth": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing symmetry shape ID

In

keepBoth

Boolean. keep both = 1, keep half = 0

Error/success code (see BwApiErrorCodes enum).

This will convert symmetry shape to regular shape.

ShapeSymmetryParentGet

Get a shape's symmetry parent shape ID.

Python C++ C# VS Server

Python

BwApi.ShapeSymmetryParentGet(garmentId, childShapeId)

C++

BwApiShapeSymmetryParentGet(garmentId, childShapeId);

C#

BwApi.ShapeSymmetryParentGet(garmentId, childShapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeSymmetryParentGet",
	"params": {
		"garmentId": "value",
		"childShapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

childShapeId

The ID of the child(symmetry) shape

Out

parentShapeId

The parent shape ID for the give child(symmetry) shape ID

Error/success code (see BwApiErrorCodes enum).

ShapeSymmetryChildGet

Get an array of a shape's symmetry children shapes.

Python C++ C# VS Server

Python

BwApi.ShapeSymmetryChildGet(garmentId, parentShapeId)

C++

BwApiShapeSymmetryChildGet(garmentId, parentShapeId);

C#

BwApi.ShapeSymmetryChildGet(garmentId, parentShapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeSymmetryChildGet",
	"params": {
		"garmentId": "value",
		"parentShapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

parentShapeId

The ID of the parent shape

Out

childShapeIds

Array containing all the child(symmetry) shape IDs

Error/success code (see BwApiErrorCodes enum).

ShapeAttachmentAttach

Attach an existing shape to another shape. This will define the added shape as an attachment shape.

Python C++ C# VS Server

Python

BwApi.ShapeAttachmentAttach(garmentId, parentShapeId, drawPlace, attachmentShapeId)

C++

BwApiShapeAttachmentAttach(garmentId, parentShapeId, drawPlace, attachmentShapeId);

C#

BwApi.ShapeAttachmentAttach(garmentId, parentShapeId, drawPlace, attachmentShapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeAttachmentAttach",
	"params": {
		"garmentId": "value",
		"parentShapeId": "value",
		"drawPlace": "value",
		"attachmentShapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

parentShapeId

Existing shape ID that will be the parent of the added shape (attachmentShape)

In

drawPlace

Where to draw the attachment, on the inside or outside layer

In

attachmentShapeId

Existing shape to be added to the parent shape as an attachment

Error/success code (see BwApiErrorCodes enum).

ShapeAttachmentDetach

Detach an attachment shape from its parent.

Python C++ C# VS Server

Python

BwApi.ShapeAttachmentDetach(garmentId, attachmentShapeId)

C++

BwApiShapeAttachmentDetach(garmentId, attachmentShapeId);

C#

BwApi.ShapeAttachmentDetach(garmentId, attachmentShapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeAttachmentDetach",
	"params": {
		"garmentId": "value",
		"attachmentShapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

attachmentShapeId

Existing shape ID which is defined as an attachment

Error/success code (see BwApiErrorCodes enum).

Calling this function with none attachment shape will return error.

ShapeAttachmentDrawingPlace

Get the drawing place (inside / outside) of the given attachment shape.

Python C++ C# VS Server

Python

BwApi.ShapeAttachmentDrawingPlace(garmentId, attachmentShapeId, drawPlace)

C++

BwApiShapeAttachmentDrawingPlace(garmentId, attachmentShapeId, drawPlace);

C#

BwApi.ShapeAttachmentDrawingPlace(garmentId, attachmentShapeId, drawPlace);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeAttachmentDrawingPlace",
	"params": {
		"garmentId": "value",
		"attachmentShapeId": "value",
		"drawPlace": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

attachmentShapeId

Existing shape defined as attachment

In

drawPlace

Where attachment is drawen, on the inside or outside parent's layer

Error/success code (see BwApiErrorCodes enum).

ShapeAttachmentIds

Get all shape's attached shape IDs.

Python C++ C# VS Server

Python

BwApi.ShapeAttachmentIds(garmentId, parentShapeId)

C++

BwApiShapeAttachmentIds(garmentId, parentShapeId);

C#

BwApi.ShapeAttachmentIds(garmentId, parentShapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeAttachmentIds",
	"params": {
		"garmentId": "value",
		"parentShapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

parentShapeId

Existing shape ID

Out

attachmentShapeId

Array containing all attachment shape IDs that are attached to the given parent shape ID

Error/success code (see BwApiErrorCodes enum).

ShapeAttachmentParentGet

Get attatched shape's attachment parent shape ID.

Python C++ C# VS Server

Python

BwApi.ShapeAttachmentParentGet(garmentId, attachmentShapeId)

C++

BwApiShapeAttachmentParentGet(garmentId, attachmentShapeId);

C#

BwApi.ShapeAttachmentParentGet(garmentId, attachmentShapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeAttachmentParentGet",
	"params": {
		"garmentId": "value",
		"attachmentShapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

attachmentShapeId

Existing shape to check if it's attachment or not

Out

parentShapeId

If attachmentShapeId is attachment, return his parent shape ID otherwise return -1

Error/success code (see BwApiErrorCodes enum).

Shape turns into attachment only after calling to BwApiShapeAttachmentAttach.

ShapeAttachment

Check if shape is attachment or not.

Python C++ C# VS Server

Python

BwApi.ShapeAttachment(garmentId, attachmentShapeId)

C++

BwApiShapeAttachment(garmentId, attachmentShapeId);

C#

BwApi.ShapeAttachment(garmentId, attachmentShapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeAttachment",
	"params": {
		"garmentId": "value",
		"attachmentShapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

attachmentShapeId

Existing shape to check if it's attachment or not

Out

attachment

Boolean (1/0) if the given shape ID is attachment or not

Error/success code (see BwApiErrorCodes enum).

Shape turns into attachment only after calling to BwApiShapeAttachmentAttach.

ShapeShowIn2DGet

Check if shape is visible in the 2D window or not.

Python C++ C# VS Server

Python

BwApi.ShapeShowIn2DGet(garmentId, shapeId)

C++

BwApiShapeShowIn2DGet(garmentId, shapeId);

C#

BwApi.ShapeShowIn2DGet(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeShowIn2DGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

show

1 - shape is visible, 0 - not visible

Error/success code (see BwApiErrorCodes enum).

ShapeShowIn2DSet

Show the shape on the 2D window or not.

Python C++ C# VS Server

Python

BwApi.ShapeShowIn2DSet(garmentId, shapeId, show)

C++

BwApiShapeShowIn2DSet(garmentId, shapeId, show);

C#

BwApi.ShapeShowIn2DSet(garmentId, shapeId, show);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeShowIn2DSet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"show": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

show

1 - show the shape, 0 - hide the shape

Error/success code (see BwApiErrorCodes enum).

ShapeMaterialIdGet

Get a shape's material (fabric) ID.

Python C++ C# VS Server

Python

BwApi.ShapeMaterialIdGet(garmentId, shapeId)

C++

BwApiShapeMaterialIdGet(garmentId, shapeId);

C#

BwApi.ShapeMaterialIdGet(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeMaterialIdGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

materialId

Get shape's material ID

Error/success code (see BwApiErrorCodes enum).

ShapeMaterialIdSet

Set a shape's material (fabric) ID.

Python C++ C# VS Server

Python

BwApi.ShapeMaterialIdSet(garmentId, shapeId, materialId)

C++

BwApiShapeMaterialIdSet(garmentId, shapeId, materialId);

C#

BwApi.ShapeMaterialIdSet(garmentId, shapeId, materialId);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

materialId

Set shape's material ID

Error/success code (see BwApiErrorCodes enum).

Set material id as -1 will clear the material from the shape.

ShapeDrapingGet

Get a shape's draping properties.

Python C++ C# VS Server

Python

BwApi.ShapeDrapingGet(garmentId, shapeId, draping)

C++

BwApiShapeDrapingGet(garmentId, shapeId, draping);

C#

BwApi.ShapeDrapingGet(garmentId, shapeId, draping);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeDrapingGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"draping": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

draping

Shape's draping properties

Error/success code (see BwApiErrorCodes enum).

ShapeDrapingSet

Set a shape's draping properties.

Python C++ C# VS Server

Python

BwApi.ShapeDrapingSet(garmentId, shapeId, draping)

C++

BwApiShapeDrapingSet(garmentId, shapeId, draping);

C#

BwApi.ShapeDrapingSet(garmentId, shapeId, draping);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeDrapingSet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"draping": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

draping

Shape's draping properties

Error/success code (see BwApiErrorCodes enum).

Use BwApiShapeDrapingGet first to get the current values, update the struct with the desired changes and only then call BwApiShapeDrapingSet with the updated struct.

ShapeStateGet

Get a shape's state.

Python C++ C# VS Server

Python

BwApi.ShapeStateGet(garmentId, shapeId)

C++

BwApiShapeStateGet(garmentId, shapeId);

C#

BwApi.ShapeStateGet(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeStateGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Valid shape returns BW_API_ERROR_SUCCESS, if shape edges are not closed returns BW_API_ERROR_SHAPE_INCOMPLETE and if shape not found returns BW_API_ERROR_OBJECT_NOT_FOUND.

ShapeCompare

Compare two shapes.

Python C++ C# VS Server

Python

BwApi.ShapeCompare(garmentId, shapeId1, shapeId2)

C++

BwApiShapeCompare(garmentId, shapeId1, shapeId2);

C#

BwApi.ShapeCompare(garmentId, shapeId1, shapeId2);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeCompare",
	"params": {
		"garmentId": "value",
		"shapeId1": "value",
		"shapeId2": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId1

Existing shape ID

In

shapeId2

Existing shape ID

Out

equal

0 = shapes are not equal, 1 = shapes are equal

Error/success code (see BwApiErrorCodes enum).

ShapeUserDataGet

Gets shape's user data that was previously stored by calling to BwApiShapeUserDataSet.

Python C++ C# VS Server

Python

BwApi.ShapeUserDataGet(garmentId, shapeId, pluginSection, key)

C++

BwApiShapeUserDataGet(garmentId, shapeId, pluginSection, key);

C#

BwApi.ShapeUserDataGet(garmentId, shapeId, pluginSection, key);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeUserDataGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"pluginSection": "value",
		"key": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

pluginSection

Specific vendor or plugIn identifier. This key will help VStitcher retrieve the correct data for the appropriate plugin. (You can specify as many sections as needed. Section is not limited to one per vendor)

In

key

Key for a specific property (e.g. "creation date", "plugin version" etc')

Out

buffer

Allocated buffer object to fill with the data previously stored by calling to BwApiGarmentUserDataSet. The returned buffer is a copy of the stored buffer so you are expected to release the buffer when you finish to use it

Error/success code (see BwApiErrorCodes enum).

ShapeUserDataSet

Sets a shape's user data.

Python C++ C# VS Server

Python

BwApi.ShapeUserDataSet(garmentId, shapeId, pluginSection, key, buffer)

C++

BwApiShapeUserDataSet(garmentId, shapeId, pluginSection, key, buffer);

C#

BwApi.ShapeUserDataSet(garmentId, shapeId, pluginSection, key, buffer);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeUserDataSet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"pluginSection": "value",
		"key": "value",
		"buffer": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

pluginSection

Specific vendor or plugIn identifier. This key will help VS retrieving the correct data for the appropriate plugin (you can specify as many sections as needed. section is not limited for one per vendor)

In

key

Key for specific property (e.g. "creation date", "plugin version" etc')

In

buffer

Buffer to store in VStitcher. VStitcher will create a copy of this buffer so you are expected to release it after calling to this function

Error/success code (see BwApiErrorCodes enum).

ShapeUserDataStrGet

Gets shape's user data that was previously stored by calling to BwApiShapeUserDataStrSet.

Python C++ C# VS Server

Python

BwApi.ShapeUserDataStrGet(garmentId, shapeId, key)

C++

BwApiShapeUserDataStrGet(garmentId, shapeId, key);

C#

BwApi.ShapeUserDataStrGet(garmentId, shapeId, key);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeUserDataStrGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"key": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

key

Key for specific property (e.g. "creation date", "plugin version" etc')

Out

userDataStr

The string that was stored in the user data

Error/success code (see BwApiErrorCodes enum).

ShapeUserDataStrSet

Sets a shape's user data.

Python C++ C# VS Server

Python

BwApi.ShapeUserDataStrSet(garmentId, shapeId, key, userDataStr)

C++

BwApiShapeUserDataStrSet(garmentId, shapeId, key, userDataStr);

C#

BwApi.ShapeUserDataStrSet(garmentId, shapeId, key, userDataStr);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeUserDataStrSet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"key": "value",
		"userDataStr": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

key

Key for specific property (e.g. "creation date", "plugin version" etc')

In

userDataStr

The string to store in the user data

Error/success code (see BwApiErrorCodes enum).

If userDataStr is NULL (Or None in python) then the key will be erase.

Previous data will be overwritten.

ShapeSurfaceAreaGet

Get a shape's surface area.

Python C++ C# VS Server

Python

BwApi.ShapeSurfaceAreaGet(garmentId, shapeId, sizeId, seamAllowance, materialId)

C++

BwApiShapeSurfaceAreaGet(garmentId, shapeId, sizeId, seamAllowance, materialId);

C#

BwApi.ShapeSurfaceAreaGet(garmentId, shapeId, sizeId, seamAllowance, materialId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeSurfaceAreaGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"sizeId": "value",
		"seamAllowance": "value",
		"materialId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

sizeId

Size of the garment

In

seamAllowance

1 for getting the surface area for the cut line, 0 for getting the surface area for the sew line

In

materialId

The material ID surface we want to calc, If matrialId is -1 then return the shape surface area

Out

area

Area of the shape

For valid shape the return value will be BW_API_ERROR_SUCCESS.

ShapeCenterGet

Get a shape's center.

Python C++ C# VS Server

Python

BwApi.ShapeCenterGet(garmentId, sizeId, shapeId)

C++

BwApiShapeCenterGet(garmentId, sizeId, shapeId);

C#

BwApi.ShapeCenterGet(garmentId, sizeId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeCenterGet",
	"params": {
		"garmentId": "value",
		"sizeId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

sizeId

Size of the garment

In

shapeId

Existing shape ID

Out

centerX

The x center of the shape

Out

centerY

The y center of the shape

For valid shape the return value will be BW_API_ERROR_SUCCESS.

ShapeSymmetryTypeGet

Get a shape's symmetry.

Python C++ C# VS Server

Python

BwApi.ShapeSymmetryTypeGet(garmentId, shapeId)

C++

BwApiShapeSymmetryTypeGet(garmentId, shapeId);

C#

BwApi.ShapeSymmetryTypeGet(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeSymmetryTypeGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

type

Shape's symmetry type (see BwApiShapeSymmetryType)

Error/success code (see BwApiErrorCodes enum).

From API version 2 if a shape has more than 1 type of symmetry the result will represent the bitwise result (i.e. BW_API_SHAPE_SYMMETRY_TYPE_INNER | BW_API_SHAPE_SYMMETRY_TYPE_X ).

ShapeMaterialIds

Get a shape's materials (fabric) IDs. This function should be used when there are multiple texture on the shape (e.g: intersection fill).

Python C++ C# VS Server

Python

BwApi.ShapeMaterialIds(garmentId, shapeId)

C++

BwApiShapeMaterialIds(garmentId, shapeId);

C#

BwApi.ShapeMaterialIds(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeMaterialIds",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

materialIds

Get shape's material IDs

Error/success code (see BwApiErrorCodes enum).

ShapeTextureOffsetGet

Get the texture offset on the given shape.

Python C++ C# VS Server

Python

BwApi.ShapeTextureOffsetGet(garmentId, shapeId, materialId, front)

C++

BwApiShapeTextureOffsetGet(garmentId, shapeId, materialId, front);

C#

BwApi.ShapeTextureOffsetGet(garmentId, shapeId, materialId, front);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeTextureOffsetGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"materialId": "value",
		"front": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape 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

front

1 - to get the offset from the front material, 0 - for getting the offset from the back material

Out

offset

Get shape's offset

Error/success code (see BwApiErrorCodes enum).

ShapeTextureOffsetBySizeGet

Get the texture offset on the given shape and size.

Python C++ C#

Python

BwApi.ShapeTextureOffsetBySizeGet(garmentId, shapeId, materialId, sizeId, front)

C++

BwApiShapeTextureOffsetBySizeGet(garmentId, shapeId, materialId, sizeId, front);

C#

BwApi.ShapeTextureOffsetBySizeGet(garmentId, shapeId, materialId, sizeId, front);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape 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

sizeId

Existing size ID (-1 to get texture offset for a current size)

In

front

1 - to get the offset from the front material, 0 - for getting the offset from the back material

Out

offset

Get shape's offset

Error/success code (see BwApiErrorCodes enum).

ShapeTextureOffsetSet

Set the texture offset on a shape.

Python C++ C# VS Server

Python

BwApi.ShapeTextureOffsetSet(garmentId, shapeId, materialId, front, offset)

C++

BwApiShapeTextureOffsetSet(garmentId, shapeId, materialId, front, offset);

C#

BwApi.ShapeTextureOffsetSet(garmentId, shapeId, materialId, front, offset);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeTextureOffsetSet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"materialId": "value",
		"front": "value",
		"offset": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape 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

front

1 - to set the offset of the front material, 0 - for setting the offset of the back material

In

offset

The texture's offset

Error/success code (see BwApiErrorCodes enum).

Use BwApiShapeTextureOffsetGet first to get the current values, update the struct and only then call BwApiShapeTextureOffsetSet with the updated struct.

ShapeTextureOffsetBySizeSet

Set the texture offset on a given shape and size.

Python C++ C#

Python

BwApi.ShapeTextureOffsetBySizeSet(garmentId, shapeId, materialId, sizeId, front, offset)

C++

BwApiShapeTextureOffsetBySizeSet(garmentId, shapeId, materialId, sizeId, front, offset);

C#

BwApi.ShapeTextureOffsetBySizeSet(garmentId, shapeId, materialId, sizeId, front, offset);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape 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

sizeId

Existing size ID (-1 to set texture offset for all sizes)

In

front

1 - to set the offset of the front material, 0 - for setting the offset of the back material

In

offset

The texture's offset

Error/success code (see BwApiErrorCodes enum).

Use BwApiShapeTextureOffsetGet first to get the current values, update the struct and only then call BwApiShapeTextureOffsetSet with the updated struct.

ShapeLineIds

Get a shape's line IDs.

Python C++ C# VS Server

Python

BwApi.ShapeLineIds(garmentId, shapeId, cross)

C++

BwApiShapeLineIds(garmentId, shapeId, cross);

C#

BwApi.ShapeLineIds(garmentId, shapeId, cross);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeLineIds",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"cross": "value"
	}
}    

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)

Out

lineIds

Array of internal line IDs (see BwApiVectorInt)

Error/success code (see BwApiErrorCodes enum).

ShapeLockGet

Check if a shape is locked or not.

Python C++ C# VS Server

Python

BwApi.ShapeLockGet(garmentId, shapeId)

C++

BwApiShapeLockGet(garmentId, shapeId);

C#

BwApi.ShapeLockGet(garmentId, shapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeLockGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

Out

lock

1 - shape is locked, 0 - not locked

Error/success code (see BwApiErrorCodes enum).

ShapeLockSet

Lock or unlock a shape.

Python C++ C# VS Server

Python

BwApi.ShapeLockSet(garmentId, shapeId, lock)

C++

BwApiShapeLockSet(garmentId, shapeId, lock);

C#

BwApi.ShapeLockSet(garmentId, shapeId, lock);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeLockSet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"lock": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

lock

1 - lock the shape, 0 - unlock the shape

Error/success code (see BwApiErrorCodes enum).

Shape3DPosFrom2DPosGet

Returns the 3D position of a 2D position of a shape.

Python C++ C# VS Server

Python

BwApi.Shape3DPosFrom2DPosGet(garmentId, shapeId, pos2D)

C++

BwApiShape3DPosFrom2DPosGet(garmentId, shapeId, pos2D);

C#

BwApi.Shape3DPosFrom2DPosGet(garmentId, shapeId, pos2D);

VS Server

{
	"id": "API processing order number",
	"function": "Shape3DPosFrom2DPosGet",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"pos2D": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

pos2D

2D position on the given shape

Out

pos3D

The 3D position of pos2D

Error/success code (see BwApiErrorCodes enum).

ShapeConvertInternalLineToHole

Convert an internal line to a hole.

Python C++ C# VS Server

Python

BwApi.ShapeConvertInternalLineToHole(garmentId, shapeId, internalLineId)

C++

BwApiShapeConvertInternalLineToHole(garmentId, shapeId, internalLineId);

C#

BwApi.ShapeConvertInternalLineToHole(garmentId, shapeId, internalLineId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeConvertInternalLineToHole",
	"params": {
		"garmentId": "value",
		"shapeId": "value",
		"internalLineId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

shapeId

Existing shape ID

In

internalLineId

Existing internal line ID

Out

holeId

The ID of the newly created hole

Error/success code (see BwApiErrorCodes enum).

ShapeHoleIds

Get a shape's hole IDs.

Python C++ C# VS Server

Python

BwApi.ShapeHoleIds(garmentId, parentShapeId)

C++

BwApiShapeHoleIds(garmentId, parentShapeId);

C#

BwApi.ShapeHoleIds(garmentId, parentShapeId);

VS Server

{
	"id": "API processing order number",
	"function": "ShapeHoleIds",
	"params": {
		"garmentId": "value",
		"parentShapeId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

parentShapeId

Existing shape ID

Out

holeIds

Array containing all hole shape IDs that are attached to the parent shape ID

Error/success code (see BwApiErrorCodes enum).

Did this answer your question?