0

I'm trying to automate with Arcpy enabling time for the layers in my Drawing order but can't figure it out. From digging I've found that the only way to do it is through CIM but there's limited resources detaling how to use CIM.

# Reference a project, map, and layer using arcpy.mp
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('Map')[0]
l = m.listLayers('GreatLakes')[0]

# Return the layer's CIM definition
l_cim = l.getDefinition('V2')

I can't find any examples to work off of except for this but don't understand the CIMFeatureTable.

1 Answer 1

1

Be sure to install the CIM viewer. I have found this invaluable when trying to dive into the CIM object model.

As you are discovering the cryptic naming and lack of examples makes navigating the help file difficult to track down what it is you need to alter.

With the viewer you can make changes to your layer through the UI and see live how the CIM updates for that layer. So when I turn on time for a layer I see in the viewer the nodes TimeFields, TimeDefinition, TimeDisplayDefinition appear and its down to you to update these properties through CIM.

Search the internet with those combinations of words and you will find other people's attempts to give you a hint of what to do.

2
  • Due to workplace computer policies I'm unable to install CIM Viewer. What I have figured out is if you conver the file to lyrx you can open it with notepad and view the JSON structure.
    – Davec433
    Commented Oct 3, 2023 at 10:14
  • It's a shame your organisation has draconian approach to installing helpful addons, holds you back, makes you less efficient, wastes your time and just adds expense to everything... Didn't know you could open a lyrx file in notepad, I've always assumed it was some sort of binary format. So a useful tip indeed!
    – Hornbydd
    Commented Oct 3, 2023 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.