3

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

asked Dec 1, 2017 at 4:37

1 Answer 1

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.

answered Dec 1, 2017 at 5:55
4
  • 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. Commented Dec 1, 2017 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 Commented Dec 1, 2017 at 6:14
  • Also try selecting all features in input_fc before running the model. Commented Dec 1, 2017 at 6:17
  • 1
    Excellent, adding the precondition between the "Valid_name" output and the 'Copy Features' tool has worked wonders. Thank you. Commented Dec 1, 2017 at 6:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.