laptop and a wrench

漏洞

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

上次发布: August 15, 2017 ArcGIS Pro
漏洞 ID 编号 BUG-000105415
已提交May 26, 2017
上次修改时间June 5, 2024
适用范围ArcGIS Pro
找到的版本1.4
操作系统Windows OS
操作系统版本7
状态Known Limit

附加信息

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)

解决办法

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.

重现步骤

漏洞 ID: BUG-000105415

软件:

  • ArcGIS Pro

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项