AnsweredAssumed Answered

Manipulating 'Time' Layer  Properties Tab Attributes via C#? ( Engine)

Question asked by ErikJL on Jan 8, 2015

I recently figured out how to use the Time tab and Time Slider tool in ArcMap to create a avi file.  However, I cannot figure out how to do it programmatically in C#. it would be nice to have the process creating the featureclass & data to dynamically set the time attributes so a user doesn't have to fiddle with the interval, extent, etc. I tried the following, but the cast to ITemporalLayer failed so I'm assuming I'm on the wrong track:


            ILayerFile layerFile = new LayerFileClass();             layerFile.Open("template.lyr");             IFeatureLayer featureLayer = (IFeatureLayer)layerFile.Layer;             featureLayer.FeatureClass = fc;             ITemporalLayer layer = (ITemporalLayer)layerFile.Layer;  //Fails here!!             layer.TemporalReference.TemporalPeriod = this.intervalInMin;             layer.TemporalReference.TemporalPeriodUnits = enumTemporalUnits.enumMinutes;


Basically what I want to do is:


1) Set the 'Layer Time Extent',

2) Set the 'Time Step Interval'

3) Check the 'Display data cumulatevly' option