Is possible usse the loop function in XML macros
Posted: 13 May 2024, 19:29
Hi hope everything going well?
I’m trying to understand macro in Avolites and I to find a way to make repetitive steps in one or less steps
Ex set legend as a icon in 10 singles macros
<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
<macro name="Set Icon as Legend for Specific Macros" id="Macros.SetLegend.Specific">
<description>This macro sets an icon as a legend for specific macros using a loop.</description>
<sequence>
<!-- Define the list of macro IDs -->
<variable name="macroIDs" type="List`1" value="1, 11, 23, 38, 45" />
<!-- Loop through each macro ID -->
<loop source="macroID" target="macroIDs">
<sequence>
<!-- Set the source handle for the current macro ID -->
<step>Handles.SetSourceHandle("Macros", $macroID$ - 1)</step>
<!-- Store icon and set as legend for the current macro ID -->
<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>
</loop>
</sequence>
</macro>
</avolites.macros>
If this function exists in XML I hope work on Avoites ?
I’m trying to understand macro in Avolites and I to find a way to make repetitive steps in one or less steps
Ex set legend as a icon in 10 singles macros
<?xml version="1.0" encoding="utf-8"?>
<avolites.macros>
<macro name="Set Icon as Legend for Specific Macros" id="Macros.SetLegend.Specific">
<description>This macro sets an icon as a legend for specific macros using a loop.</description>
<sequence>
<!-- Define the list of macro IDs -->
<variable name="macroIDs" type="List`1" value="1, 11, 23, 38, 45" />
<!-- Loop through each macro ID -->
<loop source="macroID" target="macroIDs">
<sequence>
<!-- Set the source handle for the current macro ID -->
<step>Handles.SetSourceHandle("Macros", $macroID$ - 1)</step>
<!-- Store icon and set as legend for the current macro ID -->
<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>
</loop>
</sequence>
</macro>
</avolites.macros>
If this function exists in XML I hope work on Avoites ?