Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

CONTROLLING ANIMATION SPEED

IN ARCGIS TRACKING ANALYST


Are you fighting with ArcGIS Tracking Analyst to get a smooth
animation? Here is a simple code to deal with it.
A common issue in movement representation is producing
animations. Since ArcGIS provide Tracking Analysts Playback
manager, its relatively easy to produce some animations for our
spatio-temporal data. However, if you have tried to use the
Playback Manager, probably you got disappointed: The play
button produces a jumpy non-realistic movement. The most
probable reason is related with the time rate to refresh the data
visualization. But oops! there is not any option to change it!
Dont worry, a really simple code could help us to take advantage
of the TrackingAnalystUI to change the refresh time rate.
1. In ArcGIS add a temporal layer from Tracking Analyst Add
Temporal Data toolbar
2. Open VBA (Tools > Macros > Visual basic editor or Alt+F11)
3. Open Project >ArcMap objects > ThisDocument code
window.
4. Copy and paste the code below
5. Save the project
6. Open and run the custom_playback macro from (Tools >
Macros > Open Macro)

You can customize the refresh time modifying the


piTimeControl.TimeSequenceRate value.
If youve some comments or suggestions

'SmoothAnimationforTrackingAnalyst
'Author:DanielOrellana
'Licence:CreativeCommonsBYSA
Subcustom_playback()
DimpiTrackingLayerAsITemporalLayer
DimpiMxDocAsIMxDocument
SetpiMxDoc=Document
IfTypeOfpiMxDoc.FocusMap.Layer(0)IsITemporalLayerThen
SetpiTrackingLayer=piMxDoc.FocusMap.Layer(0)
EndIf
IfpiTrackingLayerIsNothingThen
MsgBox"Error:AtemporallayerneedstobeatfitstplaceonTOC"
ExitSub
EndIf
DimpiTimeControlAsITimeControl
SetpiTimeControl=NewTimeControl
SetpiTimeControl.CurrentMap=piMxDoc.FocusMap
piTimeControl.SetVisibleApplication.hWnd,True
piTimeControl.SetTemporalReferencesFromMap

piTimeControl.TemporalMode=enumTemporalHistoric
piTimeControl.TimeSequenceRate=0.05'thetimeratevalue
If(NotpiTimeControl.Status=enumStopped)ThenpiTimeControl.Stop
piTimeControl.CurrentTime=piTimeControl.StartTime

piTimeControl.PlayenumDirection.enumForward
EndSub

You might also like