Select to view content in your preferred language

Model Builder Issue with Calculating New Field

178
6
Jump to solution
2 weeks ago
Labels (3)
LamkinKatherine
New Contributor II

Hello, I have a question regarding the model  builder in arc pro. I am trying to add a field to a layer called "length". My model runs all the way up until my "calculate geometric attributes section". When it reaches here, the model fails to run and it says value is not a part of the given list. As such, I change the value to be something in the list and run the model again. However, when I run the model again, it gives me a new error message with a new list that says my new value is not within the new list. More simply, the error message changes between the two options and the two available length calculations. Does anyone know what the issue might be? 

Attached are photos of the error messages:
 
LamkinKatherine_0-1719325209490.png

When I run with perimeter length, it gives me the above message. When I run with length  geodesic, instead of giving error message, it just turns the model grey after the requested action of calculating length.

LamkinKatherine_1-1719325322111.png

Any suggestions would be super appreciated, thank you!

 

0 Kudos
1 Solution

Accepted Solutions
DuncanHornby
MVP Notable Contributor

OK another avenue to explore, according to the help file the calculate geometry attributes takes a Feature Layer as input, you are feeding it a Feature Class. So feed output of the add field tool into a make feature layer tool which then feeds into the calculate geometry attributes tool.

View solution in original post

6 Replies
DuncanHornby
MVP Notable Contributor

You don't actually show how you have run the tool and what its parameters are, suggest you edit your question to include a screen shot of the calculate tool as it's impossible for anyone to answer this question.

LamkinKatherine
New Contributor II

LamkinKatherine_0-1719327441205.pngLamkinKatherine_1-1719327521396.png

@DuncanHornby Thanks for the feedback. Here are my screenshots. 

0 Kudos
DuncanHornby
MVP Notable Contributor

OK try creating the field but not calling it length as that is a database reserved word, try something like len_m, see if that works?

0 Kudos
LamkinKatherine
New Contributor II

Hi @DuncanHornby , thanks again for the help. Unfortunately, changing the field name didn't change anything, good idea though. Is there anything else you can think of doing? Here are the most recent tool screenshots. 

LamkinKatherine_0-1719328249704.png

LamkinKatherine_1-1719328412802.png

When I change the value to be within the given list and run the model again, it just gives me a new list that the previously used value was not in and continues this cycle.

0 Kudos
DuncanHornby
MVP Notable Contributor

OK another avenue to explore, according to the help file the calculate geometry attributes takes a Feature Layer as input, you are feeding it a Feature Class. So feed output of the add field tool into a make feature layer tool which then feeds into the calculate geometry attributes tool.

LamkinKatherine
New Contributor II

You fixed it! Thank you so much for the help!!