2

I want to iterate through a field of a feature class within a geodatabase in ArcGIS ModelBuilder, extracting each group to their own separate feature class within that same gdb.

I'd like to append the names of these groups to the end of the feature class name. As there are spaces and other invalid characters in many of the group names, I tried the Calculate Value tool to use Arc's ValidateTableName function to automatically replace the offending characters with underscores.

enter image description here

enter image description here

The model kind of works but I have an interesting anomaly where (as you can see above) an extra value of '1' has been added to the output 'Name' which serves as a precondition to the Calculate Value function. This results in '1' being added as an extra inline variable to the output feature names, causing a mismatch between the file names and the group upon which they were originally based.

How can I stop '1' from being added as an inline variable here?

Edit: interestingly if I remove the Calculate Values section the outputs are named correctly until it hits a group with an invalid character for geodatabases, at which point it falls over: enter image description here

1

I have had this issue before and I would consider it a bug in the software.

ArcGIS adds the 1 as a placeholder. Once you run the iterator it no longer needs the placeholder and it will disappear.

To get rid of the 1, you will need to run the iterator section of the model by right clicking on the iterator and clicking 'run'. (Don't worry, this wont run any of your other tools in the model, it will only run the iterator).

Once you have done that, go to the 'model' menu at the top and click 'run entire model'. It should now run as expected.

You also need to make sure that the Valid_Name has been calculated before running copy features tool. Add a precondition between the 'Valid_Name' output and the 'Copy Features' tool.

  • This didn't work for me unfortunately, I continue to get mismatched output file names starting with "Output_FC_1". I'll have to continue troubleshooting. – smh Dec 1 '17 at 6:12
  • 1
    you need to add a precondition between the 'Valid_name' output and the 'Copy Features' tool - sorry, didn't see that earlier – jbalk Dec 1 '17 at 6:14
  • Also try selecting all features in input_fc before running the model. – jbalk Dec 1 '17 at 6:17
  • Excellent, adding the precondition between the "Valid_name" output and the 'Copy Features' tool has worked wonders. Thank you. – smh Dec 1 '17 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.