Skip to main content

SmartTemplate

SmartTemplateGet SmartTemplateSet SmartTemplateCategoriesGet ...

Updated over 2 months ago

SmartTemplateGet

Check if the current garment is a smart template or not.

Python C++ C# VS Server

Python

BwApi.SmartTemplateGet(garmentId)

C++

BwApiSmartTemplateGet(garmentId);

C#

BwApi.SmartTemplateGet(garmentId);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

Out

isSmartTemplate

0 = not smart template, 1 = smart template

Error/success code (see BwApiErrorCodes enum).

SmartTemplateSet

Set the current garment as a smart template garment.

Python C++ C# VS Server

Python

BwApi.SmartTemplateSet(garmentId)

C++

BwApiSmartTemplateSet(garmentId);

C#

BwApi.SmartTemplateSet(garmentId);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

Error/success code (see BwApiErrorCodes enum).

This operation is not revertible.

SmartTemplateCategoriesGet

Get all categories available in this smart template.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoriesGet(garmentId)

C++

BwApiSmartTemplateCategoriesGet(garmentId);

C#

BwApi.SmartTemplateCategoriesGet(garmentId);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

Out

categoriesJSON

An array of Category JSON object (see schema/smart_template_category.json)

Error/success code (see BwApiErrorCodes enum).

The categories will be returned in a JSON string as an array of Category objects as described in schema/smart_template_category.json.

In addition to the fields described in schema/smart_template_category.json, 'ID' and 'parent_category_id' fields will be returned for each category.

SmartTemplateCategoryGet

Get specific category information.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoryGet(garmentId, categoryId)

C++

BwApiSmartTemplateCategoryGet(garmentId, categoryId);

C#

BwApi.SmartTemplateCategoryGet(garmentId, categoryId);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

categoryId

Existing category ID

Out

categoryJSON

Category JSON object (see schema/smart_template_category.json)

Error/success code (see BwApiErrorCodes enum).

The categories will be returned in a JSON string as an array of Category objects as described in schema/smart_template_category.json.

In addition to the fields described in schema/smart_template_category.json, 'ID' and 'parent_category_id' fields will be returned for each category.

SmartTemplateCategoryAdd

Add a new smart template category or nested category.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoryAdd(garmentId, parentCategoryId, categoryJSON)

C++

BwApiSmartTemplateCategoryAdd(garmentId, parentCategoryId, categoryJSON);

C#

BwApi.SmartTemplateCategoryAdd(garmentId, parentCategoryId, categoryJSON);

VS Server

{
	"id": "API processing order number",
	"function": "SmartTemplateCategoryAdd",
	"params": {
		"garmentId": "value",
		"parentCategoryId": "value",
		"categoryJSON": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

parentCategoryId

Empty string if this is a category or parent category ID if you want to add nested category

In

categoryJSON

Category JSON object as a string (see schema/smart_template_category.json)

Out

categoryId

The newly created category ID

Error/success code (see BwApiErrorCodes enum).

SmartTemplateCategoryUpdate

Update an existing category.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoryUpdate(garmentId, categoryId, categoryJSON)

C++

BwApiSmartTemplateCategoryUpdate(garmentId, categoryId, categoryJSON);

C#

BwApi.SmartTemplateCategoryUpdate(garmentId, categoryId, categoryJSON);

VS Server

{
	"id": "API processing order number",
	"function": "SmartTemplateCategoryUpdate",
	"params": {
		"garmentId": "value",
		"categoryId": "value",
		"categoryJSON": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

categoryId

Existing category ID

In

categoryJSON

Category JSON object as a string (see schema/smart_template_category.json)

Error/success code (see BwApiErrorCodes enum).

SmartTemplateCategoryRemove

Remove an existing category.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoryRemove(garmentId, categoryId)

C++

BwApiSmartTemplateCategoryRemove(garmentId, categoryId);

C#

BwApi.SmartTemplateCategoryRemove(garmentId, categoryId);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

categoryId

Existing category ID

Error/success code (see BwApiErrorCodes enum).

SmartTemplateCategoryIds

Get all the categories IDs in the garment.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoryIds(garmentId)

C++

BwApiSmartTemplateCategoryIds(garmentId);

C#

BwApi.SmartTemplateCategoryIds(garmentId);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

Out

categoryIds

An array of categories IDs

Error/success code (see BwApiErrorCodes enum).

SmartTemplateCategoryItemsGet

Get all category items from a category ID.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoryItemsGet(garmentId, categoryId)

C++

BwApiSmartTemplateCategoryItemsGet(garmentId, categoryId);

C#

BwApi.SmartTemplateCategoryItemsGet(garmentId, categoryId);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

categoryId

Existing category ID

Out

categoryItemsJSON

An array of CategoryItem JSON object (see schema/smart_template_category_item.json)

Error/success code (see BwApiErrorCodes enum).

The category items will be returned in a JSON string as an array of CategoryItem objects as described in schema/smart_template_category_item.json.

In addition to the fields described in schema/smart_template_category_item.json, 'ID' field will be returned for each category item.

SmartTemplateCategoryItemGet

Get specific category item information.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoryItemGet(garmentId, categoryId, categoryItemId)

C++

BwApiSmartTemplateCategoryItemGet(garmentId, categoryId, categoryItemId);

C#

BwApi.SmartTemplateCategoryItemGet(garmentId, categoryId, categoryItemId);

VS Server

{
	"id": "API processing order number",
	"function": "SmartTemplateCategoryItemGet",
	"params": {
		"garmentId": "value",
		"categoryId": "value",
		"categoryItemId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

categoryId

Existing category ID

In

categoryItemId

Existing category item ID

Out

categoryJSON

Category JSON object (see schema/smart_template_category.json)

Error/success code (see BwApiErrorCodes enum).

The category item will be returned in a JSON string as an array of CategoryItem objects as described in schema/smart_template_category_item.json.

In addition to the fields described in schema/smart_template_category_item.json, 'ID' fields will be returned for each category.

SmartTemplateCategoryItemAdd

Add a new smart template category item.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoryItemAdd(garmentId, categoryId, categoryItemJSON)

C++

BwApiSmartTemplateCategoryItemAdd(garmentId, categoryId, categoryItemJSON);

C#

BwApi.SmartTemplateCategoryItemAdd(garmentId, categoryId, categoryItemJSON);

VS Server

{
	"id": "API processing order number",
	"function": "SmartTemplateCategoryItemAdd",
	"params": {
		"garmentId": "value",
		"categoryId": "value",
		"categoryItemJSON": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

categoryId

Existing category ID

In

categoryItemJSON

CategoryItem JSON object as a string (see schema/smart_template_category_item.json)

Out

categoryItemId

The newly created category item ID

Error/success code (see BwApiErrorCodes enum).

SmartTemplateCategoryItemUpdate

Update an existing category item.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoryItemUpdate(garmentId, categoryId, categoryItemId, categoryJSON)

C++

BwApiSmartTemplateCategoryItemUpdate(garmentId, categoryId, categoryItemId, categoryJSON);

C#

BwApi.SmartTemplateCategoryItemUpdate(garmentId, categoryId, categoryItemId, categoryJSON);

VS Server

{
	"id": "API processing order number",
	"function": "SmartTemplateCategoryItemUpdate",
	"params": {
		"garmentId": "value",
		"categoryId": "value",
		"categoryItemId": "value",
		"categoryJSON": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

categoryId

Existing category ID

In

categoryItemId

Existing category item ID

In

categoryJSON

CategoryItem JSON object as a string (see schema/smart_template_category_item.json)

Error/success code (see BwApiErrorCodes enum).

SmartTemplateCategoryItemRemove

Remove an existing category item.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoryItemRemove(garmentId, categoryId, categoryItemId)

C++

BwApiSmartTemplateCategoryItemRemove(garmentId, categoryId, categoryItemId);

C#

BwApi.SmartTemplateCategoryItemRemove(garmentId, categoryId, categoryItemId);

VS Server

{
	"id": "API processing order number",
	"function": "SmartTemplateCategoryItemRemove",
	"params": {
		"garmentId": "value",
		"categoryId": "value",
		"categoryItemId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

categoryId

Existing category ID

In

categoryItemId

Existing category item ID

Error/success code (see BwApiErrorCodes enum).

SmartTemplateCategoryItemIds

Get all the item IDs of a category in the garment.

Python C++ C# VS Server

Python

BwApi.SmartTemplateCategoryItemIds(garmentId, categoryId)

C++

BwApiSmartTemplateCategoryItemIds(garmentId, categoryId);

C#

BwApi.SmartTemplateCategoryItemIds(garmentId, categoryId);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

categoryId

Existing category ID

Out

categoryItemIds

An array of items IDs of a category

Error/success code (see BwApiErrorCodes enum).

SmartTemplateRuleAdd

Capture the current state of pattern pieces (elementsJSON) following a rule.

Python C++ C# VS Server

Python

BwApi.SmartTemplateRuleAdd(garmentId, elementsJSON, ruleJSON)

C++

BwApiSmartTemplateRuleAdd(garmentId, elementsJSON, ruleJSON);

C#

BwApi.SmartTemplateRuleAdd(garmentId, elementsJSON, ruleJSON);

VS Server

{
	"id": "API processing order number",
	"function": "SmartTemplateRuleAdd",
	"params": {
		"garmentId": "value",
		"elementsJSON": "value",
		"ruleJSON": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

elementsJSON

JSON object as a string that represents the elements to capture (see schema/smart_template_elements.json)

In

ruleJSON

JSON object as a string that represents the rule to apply to the elements to capture (see schema/smart_template_rule.json)

Error/success code (see BwApiErrorCodes enum).

SmartTemplateRuleRemove

Uncapture previously captured elements following a rule.

Python C++ C# VS Server

Python

BwApi.SmartTemplateRuleRemove(garmentId, elementsJSON, ruleJSON)

C++

BwApiSmartTemplateRuleRemove(garmentId, elementsJSON, ruleJSON);

C#

BwApi.SmartTemplateRuleRemove(garmentId, elementsJSON, ruleJSON);

VS Server

{
	"id": "API processing order number",
	"function": "SmartTemplateRuleRemove",
	"params": {
		"garmentId": "value",
		"elementsJSON": "value",
		"ruleJSON": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

elementsJSON

JSON object as a string that represents the elements to un-capture (see schema/smart_template_elements.json)

In

ruleJSON

JSON object as a string that represents the rule to remove from the given element (see schema/smart_template_rule.json)

Error/success code (see BwApiErrorCodes enum).

SmartTemplateSelectionGet

Get the current selected category items.

Python C++ C# VS Server

Python

BwApi.SmartTemplateSelectionGet(garmentId)

C++

BwApiSmartTemplateSelectionGet(garmentId);

C#

BwApi.SmartTemplateSelectionGet(garmentId);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

Out

selectionJSON

JSON object as a string that represents an array of selection objects (see schema/smart_template_selection.json)

Error/success code (see BwApiErrorCodes enum).

SmartTemplateSelectionSet

Set the current selected category items.

Python C++ C# VS Server

Python

BwApi.SmartTemplateSelectionSet(garmentId, selectionJSON)

C++

BwApiSmartTemplateSelectionSet(garmentId, selectionJSON);

C#

BwApi.SmartTemplateSelectionSet(garmentId, selectionJSON);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

selectionJSON

JSON object as a string that represents an array of selection objects (see schema/smart_template_selection.json)

Error/success code (see BwApiErrorCodes enum).

SmartTemplateElementsFromSelection

Get the elements mark following a rule.

Python C++ C# VS Server

Python

BwApi.SmartTemplateElementsFromSelection(garmentId, selectionJSON)

C++

BwApiSmartTemplateElementsFromSelection(garmentId, selectionJSON);

C#

BwApi.SmartTemplateElementsFromSelection(garmentId, selectionJSON);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

selectionJSON

JSON object as a string that represents an array of selection objects (see schema/smart_template_selection.json)

Out

elementsJSON

JSON object as a string that represents the elements to capture (see schema/smart_template_elements.json)

Error/success code (see BwApiErrorCodes enum).

SmartTemplateSelectionFromElements

Get the categories that related to a given elements.

Python C++ C# VS Server

Python

BwApi.SmartTemplateSelectionFromElements(garmentId, elementsJSON)

C++

BwApiSmartTemplateSelectionFromElements(garmentId, elementsJSON);

C#

BwApi.SmartTemplateSelectionFromElements(garmentId, elementsJSON);

VS Server

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

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

elementsJSON

JSON object as a string that represents the elements to capture (see schema/smart_template_elements.json)

Out

selectionJSON

JSON object as a string that represents an array of selection objects (see schema/smart_template_selection.json)

Error/success code (see BwApiErrorCodes enum).

Did this answer your question?