Dan Patterson, Joshua Bixby
I'm connecting to a Pro map layer that has metadata, but arcpy is returning all None values in the metadata properties. I'm not seeing how making a reusable def is going to help.
I thought the screenshot from my IDE would help, but it looks like it's a distraction. Here is what I am doing. This is a map layer that has metadata defined. Assume in_project (path to aprx), map_name, and map_layer_name are strings defined above.
aprx = arcpy.mp.ArcGISProject(in_project)
map_out = aprx.listMaps(map_name)[0]
layers = map_out.listLayers()
for layer in layers:
if layer.name == map_layer_name:
map_layer_out = layer
map_layer_out
<arcpy._mp.Layer object at 0x000001D64CFCFC50>
layer_md = map_layer_out.metadata
layer_md
<arcpy.metadata.Metadata object at 0x000001D64CFC0438>
layer_md.title
type(layer_md.title)
<class 'NoneType'>
layer_md.description
type(layer_md.description)
<class 'NoneType'>
type(layer_md.tags)
<class 'NoneType'>
type(layer_md.summary)
<class 'NoneType'>
Shouldn't I be getting actual values there, like what I see in the Pro screenshot I posted?