HOW TO

Clone a template

Last Published: April 25, 2020

Summary

The script in this article uses the DeepClone request to clone a template.

Procedure



  1. Open a new script window.

    A. Activate the Project window.
    B. Click the Scripts icon.
    C. Click New.

  2. Copy the following code into the script window:

    Code:
    '-- Clone Template and Add to Template Manager

    oldTemplate = TemplateMgr.getTemplates.Get(1)
    newTemplate = Template.Make
    for each aTemplateGraphic in oldTemplate.deepclone
    newTemplate.Add(aTemplateGraphic)
    end
    newTemplate.setName(oldTemplate.getName++" - Cloned")
    newTemplate.setIcon(oldTemplate.getIcon.clone)
    newTemplate.setPortrait(oldTemplate.isPortrait)
    TemplateMgr.add(newTemplate)
    TemplateMgr.show

  3. Click the
    [O-Image] Script compile button
    button to compile the script.
  4. Click the
    [O-Image] Run compiled script button
    button to run the script.

    The Template Manager will pop up. The new template will have 'cloned' in the name.
    [O-Image] Template clone

Article ID:000004165

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic