Example ====== Copy Icon (snippet only) ====== ^ by: | kimwida, January 2019 | ^ published: | http://forum.avolites.com/viewtopic.php?f=20&t=5784#p21569 | ^ description: | copy a legend icon from another handle | {{tag>copy legend icon}} ==== functions ==== * [[:macros:function:Handles.SetSourceHandleFromHandle]] * [[:macros:function:Handles.SetIcon]] * [[:macros:function:Math.Cast.ToInteger]] * [[:macros:function:Handles.GetIconId]] * [[:macros:function:Handles.ClearSelection]] ===== Code ===== Handles.SetSourceHandleFromHandle(handle:"Location=Colours,1,3") Handles.SetIcon(Math.Cast.ToInteger(Handles.GetIconId(handle:"Location=Colours,1,1"))) 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.SetSourceHandleFromHandle'' sets a particular handle as the source handle - here: the target for the copy operation * ''Handles.SetIcon'' sets the icon of the target handle * ''Math.Cast.ToInteger'' makes sure the icon id is of the Int type * ''Handles.GetIconId'' gets the id of the icon which is currently used for another specified handle * ''Handles.ClearSelection'' clears the selection so that no handle is highlighted as selected any more ===== How to use it ===== This is a snippet only - adapt and use it in your own macros. ~~DISCUSSION~~