Documented differences between .lyrx file and .aprx layer properties?

167
2
2 weeks ago
gyetman
New Contributor II

 

Are the differences between the writable layer properties in a layer file (.lyrx) and a map layer in an aprx file documented somewhere? I often want to update layers in a project, and what I want to do appears to be supported, but doesn't work on a map layer (and presumably will work on a .lyrx file). Example below where I'd like to disable time on a large number of netcdf files in a map and the two ways I was trying to do so after loading the layer in arcpy from an .aprx file. 

 

Screenshot 2024-04-17 at 10.28.00 AM.png

Screenshot 2024-04-17 at 10.42.13 AM.png

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

presumably you have seen the classes in mapping and associated links in the help files

Alphabetical list of arcpy.mp classes—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
gyetman
New Contributor II

Yes, in fact it's part of my confusion. The layer object in the link you posted (thanks!) includes the .disableTime() function, so presumably that method can be called on a layer returned from listLayers() of the project map. When I use the method it does nothing (see the first screenshot) in my original post. I may be missing something obvious. 

 

Looking closer, I see that the isTimeEnabled property is read-only for layer, it's read/write for MapTime, so my second screenshot shows the expected behavior. 

0 Kudos