I have a geodatabase that every day enter new feature class. I want to create a tool that lists all the feature classes and, through a checkbox, can decide which feature class to be added to my dataframe.
Currently I have the following script:
import arcpy
import os
arcpy.env.workspace = "C:/Users/Usuario/Documents/Modelo Geomarketing/base/Infomacion.gdb"
datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else []
for ds in datasets:
for fc in arcpy.ListFeatureClasses(feature_dataset=ds):
path = os.path.join(arcpy.env.workspace, ds, fc)
print path
#results
C:/Users/Usuario/Documents/Modelo Geomarketing/base/Infomacion.gdb\Datos\Buses C:/Users/Usuario/Documents/Modelo Geomarketing/base/Infomacion.gdb\Datos\Gasolineras C:/Users/Usuario/Documents/Modelo Geomarketing/base/Infomacion.gdb\Datos\Bancos
I want to know what changes to make to add to my data frame by Means a checkbox feature class result, using ArcGIS 10.2.2.
-
Sounds like you want to be using an Iterator have a look at the help file here.Hornbydd– Hornbydd2014年11月05日 20:28:45 +00:00Commented Nov 5, 2014 at 20:28
-
1I'm confused about whether you want to use python (as indicated by your title) or model builder (as indicated in your post). But if using python check out the arcpy module, particularly ListFeatureClasses and AddLayer.Beck– Beck2014年11月05日 20:32:28 +00:00Commented Nov 5, 2014 at 20:32
1 Answer 1
A check box means user interaction so you will need to look at using either a Python script tool / Python toolbox or a Python Add-in. What you are actually needing is called a value table. Have a look at this link in the help doco.
Explore related questions
See similar questions with these tags.