laptop and a wrench

漏洞

When calling the Change Version ArcPy tool from a custom Python script tool in ArcGIS Pro, the tool does not alter the version of an input layer.

上次发布: January 16, 2019 ArcGIS Pro
漏洞 ID 编号 BUG-000114017
已提交May 16, 2018
上次修改时间November 21, 2024
适用范围ArcGIS Pro
找到的版本2.1.2
操作系统Windows OS
状态Known Limit

附加信息

In ArcGIS Pro, use derived parameters in the script tool to get the layer to update its version. Add a new derived output parameter to the script tool of datatype feature layer, and update the script to use the following code, and the layer that is added is correctly switched to the new version. import arcpy from arcpy import env env.overwriteOutput = True database = arcpy.GetParameterAsText(0) featureClass = arcpy.GetParameterAsText(1) name = arcpy.GetParameterAsText(2) dbaseUser = arcpy.GetParameterAsText(3) #create version in database arcpy.CreateVersion_management(database, "sde.DEFAULT", name, "PUBLIC") arcpy.AddMessage("Created version") # create featue layers layer = arcpy.MakeFeatureLayer_management(featureClass, "NewLayer").getOutput(0) arcpy.AddMessage("Created Feature Layer") #change version of database for feature layer arcpy.ChangeVersion_management("NewLayer", "TRANSACTIONAL", dbaseUser + "." + name) arcpy.AddMessage("Changed version") arcpy.SetParameterAsText(4, "NewLayer")

解决办法

The Change Version tool does work in ArcMap from a script, so it can be utilized there.

Saving the created layer in the script to a file respects the version change. When that saved layer is brought into a map in ArcGIS Pro, the version is changed successfully. This workaround cannot be used for table views.

重现步骤

漏洞 ID: BUG-000114017

软件:

  • ArcGIS Pro

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

下载 Esri 支持应用程序

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

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项