Products.itemByProductType Method

Parent Object: Products
Defined in namespace "adsk::core" and the header file is <Core/Application/Products.h>

Description

Returns the specified product, if it exists within this document.

Syntax

"products_var" is a variable referencing a Products object.
returnValue = products_var.itemByProductType(productType)
"products_var" is a variable referencing a Products object.

#include <Core/Application/Products.h>

returnValue = products_var->itemByProductType(productType);

Return Value

Type Description
Product Returns the specified item or null if the specified productType does not exist within this document.

Parameters

Name Type Description
productType string The product type string. For example, to get the product that represents the design data you use "DesignProductType" or to get the product that represent the CAM data you use "CAMProductType".

A complete list of available products can be obtained by using the Application.supportedProductTypes property.

Samples

Name Description
Generate Toolpaths API Sample Demonstrates generating the toolpaths in the active document.
Post Toolpaths API Sample Demonstrates posting toolpaths in the active document.
Save and Insert File API Sample Demonstrates creating save a new file and then inserting it into a design. To use this sample, have a design open that has been saved and run the script. It will create a new design that contains a cylinder, save it to the same folder the active design was saved to, and then insert it into the active design.

Version

Introduced in version June 2015