Appearances.itemByName Method

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

Description

Returns the specified Appearance using the name as seen in the user interface. This often isn't a reliable way of accessing a specific appearance because appearances are not required to be unique.

Syntax

"appearances_var" is a variable referencing an Appearances object.
returnValue = appearances_var.itemByName(name)
"appearances_var" is a variable referencing an Appearances object.

#include <Core/Materials/Appearances.h>

returnValue = appearances_var->itemByName(name);

Return Value

Type Description
Appearance Returns the specified appearance or null if there isn't a matching name.

Parameters

Name Type Description
name string The name of the appearance to return,.

Samples

Name Description
Material API Sample

Demonstrates using materials and appearance using the API.

To use the sample, create a new Python or C++ script and copy and paste this code, replacing the default code. The sample also used an external appearance library which you can get here. Copy that to any location on your computer and edit the path in the script. When running the script, have a design open that contains a body in the root component.

Version

Introduced in version August 2014