Select to view content in your preferred language

Show Time display on map

645
5
03-26-2013 04:43 AM
courtneygarlock
Emerging Contributor
Hi,

I need to be able to show the time display on the map. I can check the box in the time slider options that says "show time on map
display" but I was wondering if there is a script that can perform that function without having to open the time slider window manually in arcmap.

I tried clicking the the apprearance tab, which opens the Time Text Appearance box, I tried to give it an element name so I can call it in a python script but I couldn't get it to work.

Is there a way to do that in script?

Thank you,

Courtney
Tags (2)
0 Kudos
5 Replies
JeffMoulds
Esri Contributor
There is dynamic text for "time". See this topic: Working with Dynamic Text. Scroll down and there is a section on time. If you need to modify time dynamic text in a python script, see code sample #2 in the TextElement class.

Finally, the DataFrameTime object provides access to time management operations for time-enabled layers in a data frame.
0 Kudos
courtneygarlock
Emerging Contributor
Thank you, I have already looked at working with dynamic texts as well as dataframe time.

I know you can add dynamic text to the map layout, my question is: Is there a way to show the dataframe time on the "data view"
not the "layout view"  with a script??

I can click the box in the time slider, and show time on map, in data view but is there a way to add dynamic text to the data view. I do not see that as an option after reading the help again but my question is, is this possible??
0 Kudos
JeffMoulds
Esri Contributor
I see what you are asking. The "show time on map display" check box on the Time Slider Options dialog is not exposed in arcpy.
0 Kudos
LucasDanzinger
Esri Frequent Contributor
Courtney-

This is kind of a crazy workaround, but I have used it in the past and it at least worked for my scenario... Basically, I wanted some text in the layout that displayed the current feature's date/time, so I used the following workflow:

1. Create a new text field that contains the date/time, along with any other wording you want in it (i.e. Time: 3/26/12 12:00:00 AM)
2. Label your features in ArcMap
3. Convert to Annotation
4. Convert Anno to Points (Feature to Point tool)
5. Use Python to update the XY location of the new point FC so they are all sitting on top of each other at a specified XY location. The syntax would be something like:
import arcpy
field = "SHAPE@XY"
with arcpy.da.UpdateCursor("featureClass",field) as cursor:
    for row in cursor:
        row = ([(X,Y)])
        cursor.updateRow(row)

6. Label the point feature
7. Enable time on the point feature as well (make the point feature symbology size 0)
0 Kudos
courtneygarlock
Emerging Contributor
Thank you for the replies. I will try that out! Hope it works for me, I'm very new to python and kind of learning as I go so this method seems a little over my head.
0 Kudos