Changing group layout from macro

This is a place for people to chare the custom macros they have written.

Moderator: Moderators

KarrnDragon
Posts: 1
Joined: 06 Jun 2024, 18:18

Changing group layout from macro

Postby KarrnDragon » 06 Jun 2024, 18:28

Hi Forum,

I'm struggling to understand why I can not move and rotate the layout of the group from my macro.

I've written the following simple macro:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<avolites.macros xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Avolites.Menus.xsd">
  <macro id="Avolites.Macros.TestRotate" name="TEST ROTATE">
    <description>Test of macros</description>
    <sequence>
        <step>ActionScript.SetProperty.Integer("Group.Editor.Layout.PositionY",5)</step>
        <step>ActionScript.SetProperty.Integer("Group.Editor.Layout.PositionX",10)</step>
        <step>ActionScript.SetProperty.Integer("Group.Editor.Layout.Rotation",180)</step>
    </sequence>
  </macro>
</avolites.macros>


I'm using the macro like this:
* Open Group layout editor of my group
* Select group
* Activate macro

I can see in the programmer display that Position Jumps to X = 3, Y = 11 and Rotation = 180° like I specified in the macro, but the view in the layout editor does not change. If I move the wheels it updates.

Am I forgetting anything or is this a bug?

Observed with a Titan Mobile and Titan v17.

Best Regards
User avatar
Gregory
Posts: 1350
Joined: 14 Dec 2007, 15:25
Location: London, United Kingdom
Contact:

Re: Changing group layout from macro

Postby Gregory » 14 Jun 2024, 00:44

The properties mentioned, e.g. Group.Editor.Layout.PositionX, are used to output to the wheel display UI. As such setting them does not change the properties of fixtures in the group, in part this is because the value shown just represents one of the selected fixtures (the context fixture).

Instead you can call one of the following functions:

Code: Select all

Group.Editor.IncrementWheelParameter(0, 1, 0, false, true, false)
Group.Editor.IncrementWheelParameter(0, -1, 0, false, true, false)
Group.Editor.SetWheelParameter(0, 8, false, false)

The first two examples will increment or decrement the X position of the selected fixtures by one, the latter will set the X position of the context fixture to 8 while maintaining the relative positions of the other selected fixtures.

Since the first value is the wheel index (0-based) you might need to ensure the wheels are displaying the expected values.

Who is online

Users browsing this forum: No registered users and 3 guests