User Tools

Site Tools


macros:example:parkselectedfixtures

Example

Patch - Park selected fixtures

by: Gregory Haynes, August 2019
published: see http://forum.avolites.com/viewtopic.php?f=20&t=6207&p=22282
description: Parks the currently selected fixtures

functions

affected properties

The repatch menu does not actually use the PatchSelection, it has its own property Patch.Repatch.SelectedFixtureHandles.

Code

ParkSelectedFixtures.xml
<?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.ParkSelectedFixtures" name="Park Selected Fixtures">
    <description>Parks the currently selected fixtures.</description>
    <sequence>
      <step pause="0.01">Programmer.Editor.Selection.GetSelectedHandles("Windows.PatchView.Handles")</step>
      <step pause="0.01">Handles.SetSourceHandleRangeFromHandles(Windows.PatchView.Handles, true)</step>
      <step pause="0.01">Patch.Repatch.SetDmxAddressesFromSelectedFixture()</step>
      <step pause="0.01">Patch.Repatch.ParkSelectedFixtures()</step>
      <step pause="0.01">Handles.ClearSelection()</step>
    </sequence>
  </macro>
 
</avolites.macros>

Here, the pause=“0.01” seems to be required - if there is no pause, always the previously for repatching selected fixtures will be parked, and if there aren't any an exception is thrown.

Explanation

This explains the functional steps within the sequence. For all the other XML details please refer to Formats and syntax

  • The first line retrieves the current selection and stores it in a menu property, it is not important which one just that it is the correct type.
  • From that we then set the source handle selection (this is the same selection that is used for copy, move, set legend etc.).
  • The third line copies the source handle selection to the Repatch property (and initialises other properties used in the repatch menu).
  • The forth line performs the Park operation and
  • the last line clears the source handle selection once you are done.

How to use it

You could leave a comment if you were logged in.
macros/example/parkselectedfixtures.txt · Last modified: 2019/08/15 09:44 by icke_siegen