laptop and a wrench

Erro

The ArcPy map layer list in ArcGIS Pro is not updated when a layer is returned as an output parameter of a script.

Última Publicação: August 15, 2017 ArcGIS Pro
Número de ID do Erro BUG-000105415
EnviadoMay 26, 2017
Última ModificaçãoJune 5, 2024
Aplica-se àArcGIS Pro
Versão encontrada1.4
Sistema OperacionalWindows OS
Versão do Sistema Operacional7
StatusKnown Limit

Informações Adicionais

for lyr in m.listLayers (): #get layer object if lyr.name == inLyr: arcpy.AddMessage ("found lyr in map") inLyrPath = os.path.dirname (lyr.dataSource) outLyr = os.path.join (inLyrPath, outLyrName) arcpy.AddMessage ("full path to outLyr: " + outLyr) arcpy.CopyFeatures_management (inLyr, outLyr) arcpy.AddMessage ("after CopyFeatures") arcpy.SetParameterAsText (2, outLyr) #push layer out to map arcpy.AddMessage ("after SetParameterAsText") break; p = arcpy.mp.ArcGISProject ("CURRENT") #get current project m = p.listMaps () [0] #get first map in project m.addDataFromPath(outLyr) for lyr in m.listLayers (): arcpy.AddMessage ("lyr.name: " + lyr.name)

Solução Provisória

Perform any task requiring access to the new layer before exiting the loop where the layer object is current. For instance, use the MakeFeatureLayer to create a layer object and return that object to the map instead of returning the new layer 'as text.' That way the layer object can be updated, such as by applying symbology from the existing layer from which it was copied.

Etapas para Reproduzir

ID do Erro: BUG-000105415

Software:

  • ArcGIS Pro

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download