Is there a way to default Get parametersAsTest
Where when I run the tool it will be defaulted unless the user changes it.
def main():
sde_conn = arcpy.GetParameterAsText(0) or "C:\Users\xx\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\x@x.sde"
Solved! Go to Solution.
Are you creating a tool in a toolbox for your user input? If so, you you set up you default int he Parmaters box, for example:
Then in the script, you could have something like this:
# Script arguments...
targetGDB = arcpy.GetParameterAsText(0)
if not targetGDB:
targetGDB = r'\\DFGANCGISDEV3\agsdev\data\update.gdb'
Simple sample, but then you repeat for the other parameters.
edit: by the way, I should mention that they will see the default you have in the Parameter box, but can change it. The "if not" covers if nothing is input....at least you ahve the default, for example if you didn't have a default in the Parameter box, and they left the input blank, you could still have the default.
are you looking to set parameters? this is one, there are other options in the same help file vacinity
Got it with this: ArcGIS Help 10.1
Was able to set the default when I was setting parameters.
Are you creating a tool in a toolbox for your user input? If so, you you set up you default int he Parmaters box, for example:
Then in the script, you could have something like this:
# Script arguments...
targetGDB = arcpy.GetParameterAsText(0)
if not targetGDB:
targetGDB = r'\\DFGANCGISDEV3\agsdev\data\update.gdb'
Simple sample, but then you repeat for the other parameters.
edit: by the way, I should mention that they will see the default you have in the Parameter box, but can change it. The "if not" covers if nothing is input....at least you ahve the default, for example if you didn't have a default in the Parameter box, and they left the input blank, you could still have the default.