How to save and load ArcGIS animation files


Summary
ArcGIS animations can be saved to disk in the form of animation files. These files can then be loaded into the same ArcMap session or a different session. This topic shows how to save and load animation files.


Saving an ArcGIS animation file

When an animation is saved to a file, the animation environment settings, and all tracks and keyframes, are persisted. When an animation file is loaded, the persisted environment settings, tracks, and keyframes are loaded into the application.
The ArcGIS animation file extension is *.ama. For ArcGlobe, the file extension is *.aga (ArcGlobe animation file) and for ArcScene, *.asa (ArcScene animation file).
The following code example shows how to save an ArcMap animation to a *.ama file:
[C#]
public void Save_Map_Animation()
{

    //Get the animation extension. 
    IAnimationExtension animExt;
    animExt = GetAnimationExtension();

    //Get the animation track container from the animation extension. 
    IAGAnimationTracks animTracks;
    animTracks = animExt.AnimationTracks;

    //Use the AGAnimationUtils object to save the animation. 
    IAGAnimationUtils animUtils;
    animUtils = new AGAnimationUtils()as IAGAnimationUtils;
    animUtils.SaveAnimationFile(animTracks.AnimationObjectContainer, 
        "C:\\temp\\agAnimFile.ama", esriArcGISVersion.esriArcGISVersionCurrent);

}
[VB.NET]
Private Sub Save_Map_Animation()
    
    'Get the animation extension.
    Dim animExt As IAnimationExtension
    animExt = GetAnimationExtension()
    
    'Get the animation track container from the animation extension.
    Dim animTracks As IAGAnimationTracks
    animTracks = animExt.AnimationTracks
    
    'Use the AGAnimationUtils object to save the animation.
    Dim animUtils As IAGAnimationUtils
    animUtils = New AGAnimationUtils
    animUtils.SaveAnimationFile(animTracks.AnimationObjectContainer, _
                                "C:\temp\agAnimFile.ama", esriArcGISVersion.esriArcGISVersionCurrent)
    
End Sub

Loading an ArcGIS animation file

The following code example shows how to load the ArcGIS animation file into ArcMap. You can also use a similar approach to load the ArcGIS animation file into ArcGlobe and ArcScene.
[C#]
private void Load_Map_Animation()
{

    //Get the animation extension. 
    IAnimationExtension animExt;
    animExt = GetAnimationExtension();

    //Get the animation track container from the animation extension. 
    IAGAnimationTracks animTracks;
    animTracks = animExt.AnimationTracks;

    //Load the animation file using the AGAnimationUtils object. 
    IAGAnimationUtils animUtils;
    animUtils = new AGAnimationUtils()as IAGAnimationUtils;
    animUtils.LoadAnimationFile(animTracks.AnimationObjectContainer, 
        "C:\\temp\\agAnimFile.ama");

}
[VB.NET]
Private Sub Load_Map_Animation()
    
    'Get the animation extension.
    Dim animExt As IAnimationExtension
    animExt = FindAnimationExtension()
    
    'Get the animation track container from the animation extension.
    Dim animTracks As IAGAnimationTracks
    animTracks = animExt.AnimationTracks
    
    'Load the animation file using the AGAnimationUtils object.
    Dim animUtils As IAGAnimationUtils
    animUtils = New AGAnimationUtils
    animUtils.LoadAnimationFile(animTracks.AnimationObjectContainer, _
                                "C:\temp\agAnimFile.ama")
    
End Sub






Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced