Rearranges the order in which entities and groups are displayed.

Syntax

Send_Message(Ctrl, "OLE.RepositionItem", SourceItem, DestinationGroup, ItemToInsertBefore)

Parameters

ParameterDescription
SourceItemThe ID of an entity or group to be moved
DestinationGroupThe ID of the group into which the source item will be moved
ItemToInsertBeforeThe ID of the entity or group within the destination group before which the source item will be inserted

Remarks

The RepositionItem method makes it possible to rearrange entities after they have already been defined. This can be useful when you need to move an entity from one group to another. The SourceItem parameter is the key id of the group or entity you want to move. Then you use the DestinationGroup parameter to specify the key id of the group that will become its new parent. You can pass "" if you want it to have no group parent. The last parameter is ItemToInsertBefore. This is a key id of a group or entity that is a direct child of the DestinationGroup. Your item will be place immediately before the item specified in this last parameter. If you leave ItemToInsertBefore blank, then your source item will be moved to the end of the groups' children.

Example

// Move group 1 to the end of group 2
Send_Message(@Window:".OLE_SCHEDULE", "OLE.RepositionItem", "Group1", "Group2", "")

// Move entity A to the end
Send_Message(@Window:".OLE_SCHEDULE", "OLE.RepositionItem", "EntityA", "", "")

// Move entity A to be just before entity C, which is a child of group 3
Send_Message(@Window:".OLE_SCHEDULE", "OLE.RepositionItem", "EntityA", "Group3", "EntityC")
  • No labels