SmartTemplate
This file contains smart template functionality, you can create category, category items etc...
BwApiSmartTemplateGet
Check if the current garment is a smart template or not.
Python
BwApi.SmartTemplateGet(garmentId)
C++
BwApiSmartTemplateGet(garmentId, isSmartTemplate);
C#
BwApi.SmartTemplateGet(garmentId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
Out | isSmartTemplate | 0 = not smart template, 1 = smart template. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateSet
Set the current garment as a smart template garment.
Python
BwApi.SmartTemplateSet(garmentId)
C++
BwApiSmartTemplateSet(garmentId);
C#
BwApi.SmartTemplateSet(garmentId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: This operation is not revertible.
---
BwApiSmartTemplateCategoriesGet
Get all categories available in this smart template.
Python
BwApi.SmartTemplateCategoriesGet(garmentId)
C++
BwApiSmartTemplateCategoriesGet(garmentId, categoriesJSON);
C#
BwApi.SmartTemplateCategoriesGet(garmentId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
Out | categoriesJSON | An array of Category JSON object (see smart_template_category.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: The categories will be returned in a JSON string as an array of Category objects as described in smart_template_category.json.
---
BwApiSmartTemplateCategoryGet
Get specific category information.
Python
BwApi.SmartTemplateCategoryGet(garmentId, categoryId)
C++
BwApiSmartTemplateCategoryGet(garmentId, categoryId, categoryJSON);
C#
BwApi.SmartTemplateCategoryGet(garmentId, categoryId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | categoryId | Existing category ID. |
Out | categoryJSON | Category JSON object (see smart_template_category.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: The categories will be returned in a JSON string as an array of Category objects as described in smart_template_category.json.
---
BwApiSmartTemplateCategoryAdd
Add a new smart template category or nested category.
Python
BwApi.SmartTemplateCategoryAdd(garmentId, parentCategoryId, categoryJSON)
C++
BwApiSmartTemplateCategoryAdd(garmentId, parentCategoryId, categoryJSON, categoryId);
C#
BwApi.SmartTemplateCategoryAdd(garmentId, parentCategoryId, categoryJSON);
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 smart_template_category.json). |
Out | categoryId | The newly created category ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateCategoryUpdate
Update an existing category.
Python
BwApi.SmartTemplateCategoryUpdate(garmentId, categoryId, categoryJSON)
C++
BwApiSmartTemplateCategoryUpdate(garmentId, categoryId, categoryJSON);
C#
BwApi.SmartTemplateCategoryUpdate(garmentId, categoryId, categoryJSON);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | categoryId | Existing category ID. |
In | categoryJSON | Category JSON object as a string (see smart_template_category.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateCategoryRemove
Remove an existing category.
Python
BwApi.SmartTemplateCategoryRemove(garmentId, categoryId)
C++
BwApiSmartTemplateCategoryRemove(garmentId, categoryId);
C#
BwApi.SmartTemplateCategoryRemove(garmentId, categoryId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | categoryId | Existing category ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateCategoryIds
Get all the categories IDs in the garment.
Python
BwApi.SmartTemplateCategoryIds(garmentId)
C++
BwApiSmartTemplateCategoryIds(garmentId, categoryIds);
C#
BwApi.SmartTemplateCategoryIds(garmentId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
Out | categoryIds | An array of categories IDs. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateCategoryItemsGet
Get all category items from a category ID.
Python
BwApi.SmartTemplateCategoryItemsGet(garmentId, categoryId)
C++
BwApiSmartTemplateCategoryItemsGet(garmentId, categoryId, categoryItemsJSON);
C#
BwApi.SmartTemplateCategoryItemsGet(garmentId, categoryId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | categoryId | Existing category ID. |
Out | categoryItemsJSON | An array of CategoryItem JSON object (see smart_template_category_item.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: The category items will be returned in a JSON string as an array of CategoryItem objects as described in smart_template_category_item.json.
---
BwApiSmartTemplateCategoryItemGet
Get specific category item information.
Python
BwApi.SmartTemplateCategoryItemGet(garmentId, categoryId, categoryItemId)
C++
BwApiSmartTemplateCategoryItemGet(garmentId, categoryId, categoryItemId, categoryJSON);
C#
BwApi.SmartTemplateCategoryItemGet(garmentId, categoryId, categoryItemId);
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 smart_template_category.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
Note: The category item will be returned in a JSON string as an array of CategoryItem objects as described in smart_template_category_item.json.
---
BwApiSmartTemplateCategoryItemAdd
Add a new smart template category item.
Python
BwApi.SmartTemplateCategoryItemAdd(garmentId, categoryId, categoryItemJSON)
C++
BwApiSmartTemplateCategoryItemAdd(garmentId, categoryId, categoryItemJSON, categoryItemId);
C#
BwApi.SmartTemplateCategoryItemAdd(garmentId, categoryId, categoryItemJSON);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | categoryId | Existing category ID. |
In | categoryItemJSON | CategoryItem JSON object as a string (see smart_template_category_item.json). |
Out | categoryItemId | The newly created category item ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateCategoryItemUpdate
Update an existing category item.
Python
BwApi.SmartTemplateCategoryItemUpdate(garmentId, categoryId, categoryItemId, categoryJSON)
C++
BwApiSmartTemplateCategoryItemUpdate(garmentId, categoryId, categoryItemId, categoryJSON);
C#
BwApi.SmartTemplateCategoryItemUpdate(garmentId, categoryId, categoryItemId, categoryJSON);
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 smart_template_category_item.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateCategoryItemRemove
Remove an existing category item.
Python
BwApi.SmartTemplateCategoryItemRemove(garmentId, categoryId, categoryItemId)
C++
BwApiSmartTemplateCategoryItemRemove(garmentId, categoryId, categoryItemId);
C#
BwApi.SmartTemplateCategoryItemRemove(garmentId, categoryId, categoryItemId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | categoryId | Existing category ID. |
In | categoryItemId | Existing category item ID. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateCategoryItemIds
Get all the item IDs of a category in the garment.
Python
BwApi.SmartTemplateCategoryItemIds(garmentId, categoryId)
C++
BwApiSmartTemplateCategoryItemIds(garmentId, categoryId, categoryItemIds);
C#
BwApi.SmartTemplateCategoryItemIds(garmentId, categoryId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | categoryId | Existing category ID. |
Out | categoryItemIds | An array of items IDs of a category. |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateRuleAdd
Capture the current state of pattern pieces (elementsJSON) following a rule.
Python
BwApi.SmartTemplateRuleAdd(garmentId, elementsJSON, ruleJSON)
C++
BwApiSmartTemplateRuleAdd(garmentId, elementsJSON, ruleJSON);
C#
BwApi.SmartTemplateRuleAdd(garmentId, elementsJSON, ruleJSON);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | elementsJSON | JSON object as a string that represents the elements to capture (see smart_template_elements.json). |
In | ruleJSON | JSON object as a string that represents the rule to apply to the elements to capture (see smart_template_rule.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateRuleRemove
Uncapture previously captured elements following a rule.
Python
BwApi.SmartTemplateRuleRemove(garmentId, elementsJSON, ruleJSON)
C++
BwApiSmartTemplateRuleRemove(garmentId, elementsJSON, ruleJSON);
C#
BwApi.SmartTemplateRuleRemove(garmentId, elementsJSON, ruleJSON);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | elementsJSON | JSON object as a string that represents the elements to un-capture (see smart_template_elements.json). |
In | ruleJSON | JSON object as a string that represents the rule to remove from the given element (see smart_template_rule.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateSelectionGet
Get the current selected category items.
Python
BwApi.SmartTemplateSelectionGet(garmentId)
C++
BwApiSmartTemplateSelectionGet(garmentId, selectionJSON);
C#
BwApi.SmartTemplateSelectionGet(garmentId);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
Out | selectionJSON | JSON object as a string that represents an array of selection objects (see smart_template_selection.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateSelectionSet
Set the current selected category items.
Python
BwApi.SmartTemplateSelectionSet(garmentId, selectionJSON)
C++
BwApiSmartTemplateSelectionSet(garmentId, selectionJSON);
C#
BwApi.SmartTemplateSelectionSet(garmentId, selectionJSON);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | selectionJSON | JSON object as a string that represents an array of selection objects (see smart_template_selection.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateElementsFromSelection
Get the elements mark following a rule.
Python
BwApi.SmartTemplateElementsFromSelection(garmentId, selectionJSON)
C++
BwApiSmartTemplateElementsFromSelection(garmentId, selectionJSON, elementsJSON);
C#
BwApi.SmartTemplateElementsFromSelection(garmentId, selectionJSON);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | selectionJSON | JSON object as a string that represents an array of selection objects (see smart_template_selection.json). |
Out | elementsJSON | JSON object as a string that represents the elements to capture (see smart_template_elements.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
---
BwApiSmartTemplateSelectionFromElements
Get the categories that related to a given elements.
Python
BwApi.SmartTemplateSelectionFromElements(garmentId, elementsJSON)
C++
BwApiSmartTemplateSelectionFromElements(garmentId, elementsJSON, selectionJSON);
C#
BwApi.SmartTemplateSelectionFromElements(garmentId, elementsJSON);
Parameters
Param | Variable | Description |
In | garmentId | Existing garment ID. |
In | elementsJSON | JSON object as a string that represents the elements to capture (see smart_template_elements.json). |
Out | selectionJSON | JSON object as a string that represents an array of selection objects (see smart_template_selection.json). |
Returns: Error/success code (see BwApiErrorCodes enum).
---