MakeXYEventLayer_management

664
4
04-18-2013 07:32 AM
NadeemQazi
New Contributor III
Hi

I have created a new layer using MakeXYEventLayer_management using python scripting. I want to make this newly created layer time enabled pragmatically. Is there any way to do it. thanks in advance
Nadee
Tags (2)
0 Kudos
4 Replies
KerryAlley
Occasional Contributor
Hi Nadeem,

You'll need another layer that already has it's time properties set as desired (set manually in ArcMap).  Then when you create a layer, you can update its time properties using the other layer as a source using arcpy.mapping.UpdateLayerTime().  It should only update the time properties.

Good Luck!
Kerry
0 Kudos
NadeemQazi
New Contributor III
Hi Kerry
Thnx for the help.  also is it also possible to enable the "enable time  on this layer" property of  a layer  through python programming.I mean rather than doing it manually in ARCMAP, i wish to do it through python script.
Regards
Nadeem
0 Kudos
KerryAlley
Occasional Contributor
The "isTimeEnabled" property is actually a property of the "LayerTime" property, and "LayerTime" is a property of the layers you're working with.  Both of those properties are Read Only, so you can't edit them *directly* with Python code.  Fortunately, layer time properties can be "updated" in Python (using the UpdateLayerTime function that I mentioned in my last post).  As long as you enable the time on the layer file that you're using as a "time properties template," then any layer that you update with it will be time enabled.  I don't know why Esri won't let us change the "isTimeEnabled" property directly.

Kerry
0 Kudos
NadeemQazi
New Contributor III
The "isTimeEnabled" property is actually a property of the "LayerTime" property, and "LayerTime" is a property of the layers you're working with.  Both of those properties are Read Only, so you can't edit them *directly* with Python code.  Fortunately, layer time properties can be "updated" in Python (using the UpdateLayerTime function that I mentioned in my last post).  As long as you enable the time on the layer file that you're using as a "time properties template," then any layer that you update with it will be time enabled.  I don't know why Esri won't let us change the "isTimeEnabled" property directly.

Kerry


thanks kerry. I want to ask one more thing . It is about the "Time slider" control . I have used it from the toolbar. I have manually set its property and it plays temporal data in my layer. However I want to make a python script that automatically activate the Time slider control I mean user does not need to click the Time slider rather the python script  should show it. Additionaly i also wish to stop and play the control using the python script. I know there is a DataFrameTime object that could be used to change the properties of Time slider but I am not sure how to actually use it to play, stop and pause the Time slider control .
Thank you in advance
regards
nadeem
0 Kudos