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.
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, or an Accessory Slot's selected Component referring to such a part.
Enabled Boolean No Whether to generate this part instance. Defaults to true; false omits the entry.
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, Enabled: true, 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.

Set a record's Enabled to a Boolean expression to toggle that instance without filtering the vector. Missing or null values default to true. Disabled records create no component or nested configuration and do not participate in key collision handling. Default keys still use the original vector indices, so disabling an earlier record does not change later records' default keys. Re-enabling a removed instance creates a new component and nested configuration.

The order of records controls the order of generated components. Part references use the same value conversion as a Slot's AutoOption. Records with a missing or null part, or a reference that does not resolve to an available part, are ignored. Invalid Part, Position, or Rotation conversions produce a script error for Parts and the affected record is omitted.

For a shared accessory, set the root Accessory Slot's IsRendered to false and reference one shared Item List of physical leg parts from both that slot and every leg layout. Use { Part: Root.SlotName.Component, ... } in the layouts' records. Like a Slot's AutoOption, the reference is resolved against the layout's allowed options by exact runtime ID first, then product item identity. Name matching is used only as a backwards-compatible fallback when neither identity matches. The choice slot emits no 3D content, while each layout places its own rendered instances at the authored positions.

Child-side Plug connector

A child part can define a Plug property set to adjust its placement from the child's perspective, using the same connector calculation as an Accessory Slot. The structure's RootConnector locates the structure; the record's Position and Rotation locate an attachment frame within that structure. The child's Plug.ConnectionPoint is aligned to that frame, so the final part pivot may differ from the record's position and rotation.

The plug supports Alignment, Offset, AlignedOffset, and Rotation relative to the child's bounding box. Scripted connector values run in the child component's context, so they can refer to child properties, Parent for the scripted structure, and Root for product-level values. Placement applies the inverse child connector, then the record rotation and translation, then the structure root transform.

Only an explicitly authored Plug affects scripted placement. Without Plug, the record continues to position the part's pivot directly, including models whose bounds are offset from their pivot. An explicit Plug with default values instead attaches at the bounding-box center, just as it does in a Slot. Existing Plugs on scripted children take effect when the runtime product is regenerated.