Table of Contents

Scripted Structure

Overview

Scripted Structure creates and positions automatic child parts from a script. Use it when the set, order, or transform of parts is easier to describe as data than through an interactive structure such as Linear or Free Placement.

Add a Scripted Structure to a product, part, option group, or item list, then add the parts that the script may return as children of the structure.

Components in a Scripted Structure cannot be added, removed, reordered, or moved directly in Planner. Change the Parts script or the properties it depends on to update the generated components.

Base properties

RootProperties

![ITEM_TYPE: ScriptedStructureDefinition]

Property Name Type Localized Description
Enabled Toggle/scripting N Enables or disables the structure and all parts generated under it.
DisplayName Text field Y Name shown for the structure.
ItemPlacement Selection N Controls how the structure is placed when its parent item is selected.
RootConnector Connector N Positions and rotates the automatic structure root relative to its parent component.
Parts Scripting N Returns the ordered vector of part records used to generate the structure.

Parts script

The Parts property must return a vector of anonymous records. Each record supports these fields:

Field Type Required Description
Part Part reference Yes A part or option group available under this Scripted Structure.
Position Vector3 No Position relative to the structure root. Defaults to [0, 0, 0].
Rotation Vector4 No Quaternion in [x, y, z, w] order relative to the structure root. Defaults to [0, 0, 0, 1].
Key String No Stable identity for the generated component. Defaults to the record's zero-based index.

For example:

[
  { Part: LeftLeg, Position: [-0.5, 0, 0], Key: 'left-leg' },
  { Part: RightLeg, Position: [0.5, 0, 0], Key: 'right-leg' }
]

Key preserves component identity and nested configuration when the script result is reordered or its transforms change. Keys must be unique and non-empty. Records with a missing, empty, duplicate, or otherwise colliding key use their invariant zero-based source index instead.

The order of records controls the order of generated components. Records that do not resolve to an available part are ignored.