User Tools

Site Tools


macros:example:seticonlegend

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 Avolites Showfile Parser might help (upload a show and hit Show Legends).

functions

affected properties

Code

seticonlegend.xml
<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
 
  <macro name="Set Icon as Legend" id="Macros.SetLegend.Icon">
    <sequence>
      <step>Handles.SetSourceHandle("Colours", 0)</step>
      <step>Icons.StoreIcon("1caf5766-67e1-41a0-aec4-dc821f1c160a", "Expert.Legend.Set.Generic.PendingTitanId")</step>
      <step>Handles.SetIcon(Expert.Legend.Set.Generic.PendingTitanId)</step>
      <step>Handles.ClearSelection()</step>
    </sequence>
  </macro>
 
</avolites.macros>

Explanation

This explains the functional steps within the sequence. For all the other XML details please refer to 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

  • this sets a specific handle to a specific quicksketch legend:
  • 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.
You could leave a comment if you were logged in.
macros/example/seticonlegend.txt · Last modified: 2019/04/27 13:30 by sideshowbond