ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Animation Class / Duration Property
Example

In This Topic
    Duration Property (Animation)
    In This Topic
    Gets the length of time of all tracks in the animation.
    Syntax
    Public ReadOnly Property Duration As TimeSpan
    public TimeSpan Duration {get;}
    Example
    Set Animation Length
    {
      var animation = mapView.Map.Animation;
      var duration = animation.Duration;
      if (duration == TimeSpan.Zero)
        return;
    
      var factor = length.TotalSeconds / duration.TotalSeconds;
      animation.ScaleDuration(factor);
    }
    Scale Animation
    {
      var animation = mapView.Map.Animation;
      var duration = animation.Duration;
      if (duration == TimeSpan.Zero || duration <= afterTime)
      {
        // Nothing to scale, leave
      }
    
      var factor = length.TotalSeconds / (duration.TotalSeconds - afterTime.TotalSeconds);
      animation.ScaleDuration(afterTime, duration, factor);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also