Pro arcpy - setting time property on layer or feature class

444
3
08-03-2020 03:37 PM
AngusHooper1
Occasional Contributor II

How can I set the time properties for a feature class or a layer via arcpy? For example, it appears that the layerTime classes are not available in Pro when compared to ArcMap?

Set the time properties on data—ArcGIS Pro | Documentation 

LayerTime—ArcMap | Documentation 

Tags (3)
0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

A lot is different in on the mapping side

Migrating from arcpy.mapping to ArcGIS Pro—ArcGIS Pro | Documentation 

But for sure Joshua Bixby‌ says no in this thread

Does Pro Py have a method to access the time property in a time-enabled layer? 

and I can't find one either or a replacement in CIM

Python CIM access—ArcGIS Pro | Documentation 

But, on a lark, have you just tried replacing 'mapping' with 'mp' ?  I don't have a time-enable layer to check, perhaps it is just missing from the help docs

arcpy.mapping.Layer(r'C:\Project\Data\Time\TemperatureWithTime.lyr')

arcpy.mp.Layer(r'C:\Project\Data\Time\TemperatureWithTime.lyr')


... sort of retired...
0 Kudos
AleksandraZietara
New Contributor III

Angus, have you ever found a solution to this problem?

0 Kudos
TracyThorleifson
New Contributor III

Angus Hooper‌, Aleksandra Zietara‌, layer time properties are accessible via the CIM and embedded in the feature table (CIMFeatureTable) properties. See:

I'm not sure how long those items have been exposed in the CIM, but it's been at least since 2.5. Hope that helps! 🙂