Example ====== Legend - Set an icon as legend ====== ^ by: | Sebastian Beutel, February 2019 | ^ published: | here | ^ description: | set an icon as legend | ^ remarks: | This refers to the icons which are in the library on the very machine. On the PC suite they are stored in ''C:\Users\...\AppData\Roaming\Avolites\Icon Library\Archive\Factory''. To get a specific file, the [[https://www.avosupport.de/downloads/d4z/|Avolites Showfile Parser]] might help (upload a show and hit ''Show Legends''). | {{tag>set icon legend quicksketch}} ==== functions ==== * [[:macros:function:Handles.SetSourceHandle]] * [[:macros:function:Icons.StoreIcon]] * [[:macros:function:Handles.SetIcon]] * [[:macros:function:Handles.ClearSelection]] ==== affected properties ==== * [[:macros:property:Expert.Legend.Set.Generic.PendingTitanId]] ===== Code ===== Handles.SetSourceHandle("Colours", 0) Icons.StoreIcon("1caf5766-67e1-41a0-aec4-dc821f1c160a", "Expert.Legend.Set.Generic.PendingTitanId") Handles.SetIcon(Expert.Legend.Set.Generic.PendingTitanId) Handles.ClearSelection() ===== 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]] * ''Handles.SetSourceHandle("Colours", 0)'' selects a handle to set its legend * ''Icons.StoreIcon("..", "..")'' makes sure the icon is stored in the showfile, and gives it a new TitanId. This returned in the property which is passed as 2nd parameter - here: ''Expert.Legend.Set.Generic.PendingTitanId'' * ''Handles.SetIcon(...)'' finally sets this imported icon, identified by its Id, as legend for the selected handle * ''Handles.ClearSelection()'' finally deselects the handle ===== How to use it ===== * [[:macros:deploying|make this macro available]] * this sets a specific handle to a specific quicksketch legend: {{:macros:example:quicksketch.png|}} * the use of this macro appears to be very limited. However, it can be used in larger macros to initialise a show and set the legends. ~~DISCUSSION~~