Copyright © 2021 by K4.org
  (v.0.48.124)

A UIPalette is a control that allows displaying a hierarchically organized library of items and handles dropping items to the model (via UIGeometryViewer).

Index

Rules

childNameMethodName

childNameMethodName: String

The name of the method rule under the childNameParentRefChain, that can be used for generating the child rule name for the dropped part. Example getTargetChileName.

The method must have the following signature: getTargetChileName(targetRefchain: string, itemKey: string): string.

The arguments of the method are the target refchain, where the item will be added, and the item key.

The return value is a child name of the target child rule.

Flags : Cached, Parameter, Spec (Note this is uncached)

Expression : ""

childNameParentRefChain

childNameParentRefChain: String

The reference chain to the owner of the child name generation method. See childNameMethodName for details.

Flags : Cached, Parameter, Spec (Note this is uncached)

Expression : ""

controlType

controlType: String

Internal Use Only.

Flags : Cached (Note this is uncached)

Expression : "Palette"

defaultTargetRefChain

defaultTargetRefChain: String

The default model refChain (if targetParentRefChain and targetMethodName are not specified) where the dropped item will be added to as a child. If omitted, the new items will be added under the model root.

Flags : Cached, Parameter, Spec (Note this is uncached)

Expression : R.rootModel.refChain

itemsExpression

itemsExpression: String

The expression that, when evaluated on the client after loading the UI, returns the palette items hierarchy (in form of an array).

Each element can be either a category or an item.

The category format is this:

{
  category: string;
  children: any[];
}

where children is an array of lower level categories, or category items.

The item format is this:

{
  title: string;
  thumbnail: string;
  key?: string;
  dropData: {
    dragData: DragData;
    bbox: Box3;
    instanceMetadata: {
      designName: string;
      qty?: number;
      parameters?: { [param: string]: any; }
    }
  }
}

Where:

  • title is a title of the item.
  • thumbnail is a URL to the thumbnail image of the item. The square images are recommended, otherwise the image will be fit into the square placeholder.
  • key is an identifier of the item or family of the items, that is used for customizing the target refChain where the item with this key will be added.
  • dropData contains the information about how the item will visualized during drag-drop operation, how the item behaves when dragged into to the geometry viewer, and how the dropped item instantiated in the model.

The dropData format is this:

  • dragData is a definition of how the item can be positioned on the scene (using free drag, or constrained by connectors, grid).
  • bbox is a bounding box of the item.
  • instanceMetadata defines the item instantiation details.
  • designName - the name of the design to be instantiated.
  • qty (optional) - the quantity.
  • parameters (optional) - the instance parameters.

Flags : Cached, Parameter, Spec, Required (Note this is uncached)

Expression : ``

selectedItemBindParent

selectedItemBindParent: Any

The owner of the selectedItemBindTarget rule.

Flags : Cached, Parameter, Spec (Note this is uncached)

Expression : this

selectedItemBindTarget

selectedItemBindTarget: String

The name of the rule to bind the selected item's data to.

The item format is this:

{
key?: string;
instanceMetadata: {
designName: string;
qty?: number;
parameters?: { [param: string]: any; }
}
}

Where:

  • key is an identifier of the item or family of the items, that is used for customizing the target refChain where the item with this key will be added.
  • instanceMetadata defines the item instantiation details.
  • designName - the name of the design to be instantiated.
  • qty (optional) - the quantity.
  • parameters (optional) - the instance parameters.

Flags : Cached, Parameter, Spec (Note this is uncached)

Expression : ""

targetMethodName

targetMethodName: String

The name of the method rule under the targetParentRefChain, that can be used for determining the target model for the dropped part. Example getTargetRefchain.

The method must have the following signature: getTargetRefchain(itemKey: string): string.

The argument of the method is a item key.

The return value is a refChain of the target model, where the dropped item will be added to as a child.

Flags : Cached, Parameter, Spec (Note this is uncached)

Expression : ""

targetParentRefChain

targetParentRefChain: String

The reference chain to the owner of the instance target customization method. See targetMethodName for details.

Flags : Cached, Parameter, Spec (Note this is uncached)

Expression : ""