I'm using 10.2.2 arcgis
I have the following script
import arcpy
mxd = arcpy.mapping.MapDocument ("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
addLayer = arcpy.mapping.Layer(r"C:\Users\Document\Geomarketing\Datos20140826円\rest\PG_Restaurantes_GT.shp")
arcpy.mapping.AddLayer(df, addLayer, "BOTTOM")
del mxd, addLayer
The function of this script is to add a specific layer to my dataframe. I want to add this script into a model, my purpose is to have a checkbox to have the option to add or not to add the layer.
I am new to this and do not know what changes should I make to my script to let me do this in modelbuider.
Do I do this in my script?
1 Answer 1
You will need to create a boolean variable and define it as a model parameter. This will add a check box option when double clicking on the model.
OR
Create a script tool that runs your code and has a boolean data type.
Either way you will have to check the boolean value using an if statement.
Explore related questions
See similar questions with these tags.