Example ====== Programmer - Align Fixtures ====== ^ by: | Kim Wida, June 2018 | ^ published: | http://forum.avolites.com/viewtopic.php?f=20&t=5796 | ^ description: | Align Fixtures with spread | ^ remarks: | somewhat uncomplete as the alignMask is missing | {{tag>align fixture mask}} ==== functions ==== * [[:macros:function:ActionScript.SetProperty.Boolean]] * [[:macros:function:ActionScript.SetProperty.Enum]] * [[:macros:function:Selection.Context.Programmer.SelectFixture]] * [[:macros:function:Palette.ApplyPalette]] * [[:macros:function:Group.RecallGroupNumeric]] * [[:macros:function:AlignSelection.SelectFixture]] * [[:macros:function:Programmer.Editor.Fixtures.Align]] ==== affected properties ==== * [[:macros:property:Programmer.Editor.Fixtures.ClearAlignMask]] * [[:macros:property:Programmer.Editor.Fixtures.AlignMode]] * [[:macros:property:Programmer.Editor.Fixtures.AlignAddAllToProgrammer]] * [[:macros:property:Programmer.Editor.Fixtures.AlignCopyPaletteReferences]] ===== Code ===== Test Align ActionScript.SetProperty.Boolean("Programmer.Editor.Fixtures.ClearAlignMask",false) ActionScript.SetProperty.Enum("Programmer.Editor.Fixtures.AlignMode","Interpolate") ActionScript.SetProperty.Boolean("Programmer.Editor.Fixtures.AlignAddAllToProgrammer",false) ActionScript.SetProperty.Boolean("Programmer.Editor.Fixtures.AlignCopyPaletteReferences",false) Selection.Context.Programmer.SelectFixture(handle:"Location=Fixtures,1,1") Palette.ApplyPalette(handle:"Location=Colours,1,14", false) Selection.Context.Programmer.SelectFixture(handle:"Location=Fixtures,1,8") Palette.ApplyPalette(handle:"Location=Colours,1,15", false) Group.RecallGroupNumeric(5) AlignSelection.SelectFixture(handle:"Location=Fixtures,1,1") AlignSelection.SelectFixture(handle:"Location=Fixtures,1,8") Programmer.Editor.Fixtures.Align() ===== Explanation ===== This explains the functional steps within the sequence. For all the other XML details please refer to [[:macros:formats_and_syntax#xml_format|Formats and syntax]] The macro works pretty similar to how align is called in real life: * a few parameters are set * ''Programmer.Editor.Fixtures.ClearAlignMask'' is the Auto Reset Mask menu item * ''Programmer.Editor.Fixtures.AlignMode'' sets whether the values should be repeated or spread * ''Programmer.Editor.Fixtures.AlignAddAllToProgrammer'' lets the aligned values not go into the programmer * ''Programmer.Editor.Fixtures.AlignCopyPaletteReferences'' is the Palette References Lost/Maintained menu button * some fixtures are set to some palettes (fixture 1 to palette 14, fixture 8 to palette 15) * the fixtures which shall be aligned are called by their group (group 5) * the align command is called As mentioned in the forum, currently the AlignMask canot be set: >It works. But I don't know how to set align mask. > > ActionScript.SetProperty.SetFlag("Attribute.Mask.Align.Value","C") ActionScript.SetProperty.String("Attribute.Mask.Align.Value","C") ActionScript.SetProperty("Attribute.Mask.Align.Value","C") >They don't work. ===== How to use it ===== - [[:macros:deploying|make this macro available]] ~~DISCUSSION~~