Skip to content

Group

A group combines several elements into one: they move and stretch together, and the visibility and operator control enable animations act on the whole group. Coordinates of nested elements are counted from the group’s corner. A group is created in the editor from the selected elements with the Group command (Ctrl+G).

If the same drawing repeats many times with different tags, make it a genie: editing the genie changes all instances at once.

Only the properties of every element: name, position, size, tooltip, rotation, transparency, operate right.

Item.Type = Group. Any property is read and changed by name: Item.Width = 200. The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.

Mouse, hover, focus and keyboard — as for any element (see Events and functions).

Hide the whole unit — together with all nested elements.

Screen.Items("MeteringUnit").Visible = Tags("Meter.Installed").Value;

A nested element of the group — by name with Children.

var g = Screen.Items("Pump1");
g.Children("Label").Text = "Pump 1 — standby";
HMI.ShowMessage("Elements in the group: " + g.Children().length);

Stretch the group — nested elements scale with it.

var g = Screen.Items("Diagram");
g.Resize(g.Width * 1.5, g.Height * 1.5);