AnsweredAssumed Answered

Create Feature Name from GetParametersAsText()

Question asked by JCanno on Apr 28, 2019
Latest reply on Apr 29, 2019 by Dan_Patterson

New to Python and rarely post here so I am sure my question formatting is not correct. No errors to show because I do because test code runs but returns nothing and no code to post because it is mostly in functions and not tied to the issue. 

I have to "create a fire box feature class name based on the user provided box number". This feature class name will be used as a parameter for a function or assigned a variable that will be used as a parameter in a function (in a script not in a tool) that will check for fields existence and add fields if needed.

I am required to have, boxname = arpy.GetParameterAsText(0) with the input being the "box number", 35 for example.

The feature classes already exist in a geodatabase as FireBoxMap_35 etc. (there are 43 total features), so I know I do not want to replace or add the feature class name into the geodatabase and I can't change the names. 

Previous script in this assignment (without functions), used fcname = arcpyListFeatureClasses("FireBoxMap*") to find all feature classes so I have tried fcname = acrpy.ListFeatureClasses("FireBoxMap*" + boxname) which gives me the correct name but does not work once I pass it to arcpy.ListFields() to test it, no errors, just no fields. Going to test concatenating and SQL queries but have not worked out if that is the way to go here or how to put it together. Any assistance on this would be greatly appreciated. 

Outcomes