Questions tagged «value-table»

1
在Python工具箱工具中设置值表的默认值
我创建了一个Python工具箱工具来对字段重新排序,并使用重新排序的字段创建新的要素类。该工具运行良好,并且我可以使用值表让用户按他们选择的顺序排列字段,也可以为每个字段填写排名值。但是,此工具的烦人之处在于,在重新排序之前,所有字段都必须一次添加到值表中。 我试图将其设置为默认情况下将所有字段引入值表,并且可以在重新排序之前删除所有不需要的字段。以前有人做过这样的事吗?我试图在UpdateParameters方法中实现这一点。这是我正在尝试的代码: import arcpy import os class Toolbox(object): def __init__(self): """Define the toolbox (the name of the toolbox is the name of the .pyt file).""" self.label = "Reorder Fields" self.alias = "Reorder Fields" # List of tool classes associated with this toolbox self.tools = [ReorderFields] class ReorderFields(object): def __init__(self): """Define …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.