Product: SetShape

By default, a product is a cube but it can be changed to a custom shape. The shapes are imported in the project (see ‘Project Explorer > System > Shapes’). The shape can be changed with scripting either by using the Shape property or using the SetShape method.

Can be called to change this product from the current shape to a new shape from the available Shapes. If the specified shape does not exist there is no error and the original shape is retained. Reading the Shape property returns the new shape name even if it did not exist. A shape set in the system properties becomes the default shape so a read of Shape returns an empty string.

Function

void SetShape(shapeName: string)

Parameters

Name Type Description
shapeName String The shape name to set as the current product shape for this product

Return Value

None

Example

// Set the shape (2 ways of doing it)
product.SetShape("Car");
product.Shape = "Car";

// Get the shape
LogDebug("Shape=" + product.Shape);