ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / CameraTrack Class
Members Example

In This Topic
    CameraTrack Class
    In This Topic
    A track containing a collection of CameraKeyframe objects that defines the view direction and rotation during the animation.
    Object Model
    CameraTrack ClassKeyframe Class
    Syntax
    public sealed class CameraTrack : Track 
    Public NotInheritable Class CameraTrack 
       Inherits Track
    Example
    Camera Keyframes
    public List<CameraKeyframe> GetCameraKeyframes()
    {
      var mapView = MapView.Active;
      if (mapView != null)
        return null;
    
      var animation = mapView.Map.Animation;
      var cameraTrack = animation.Tracks.OfType<CameraTrack>().First(); //There will always be only 1 CameraTrack in the animation.
      return cameraTrack.Keyframes.OfType<CameraKeyframe>().ToList();
    }
    Create Camera Keyframe
    public void CreateCameraKeyframe(TimeSpan atTime)
    {
      var mapView = MapView.Active;
      if (mapView != null)
        return;
    
      var animation = mapView.Map.Animation;
      var cameraTrack = animation.Tracks.OfType<CameraTrack>().First(); //There will always be only 1 CameraTrack in the animation.
      cameraTrack.CreateKeyframe(mapView.Camera, atTime, ArcGIS.Core.CIM.AnimationTransition.FixedArc);
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Mapping.Track
          ArcGIS.Desktop.Mapping.CameraTrack

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also