Quantcast
Channel: Question and Answer » modelbuilder
Viewing all articles
Browse latest Browse all 135

Using Feature Class name to populate new field

$
0
0

I am trying to get the Feature Class name (from Iterate Feature Classes) into a new field. I have been following the models described in the following two threads.

Using Value from Iterate Feature Selection to Calculate Field in ArcMap 10.1 ModelBuilder

and

this one

However, whenever I run the model I get the following error message

ERROR 000539: Error running expression: CF0140r01
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘CF0140r01′ is not defined
Failed to execute (Calculate Field)

I have tried it using Parse Path using %Value% in the expression field (here is my model) enter image description here(http://i.imgur.com/aOFgCgJ.jpg)
and I have tried it with the Parse Path tool removed , entering %Name% in the Expression box for Calculate Field

I get the same error message either way


Here are two screen shots of the Feature folder
enter image description here

and the Calculate Field
enter image description here

I have tried to simplify this model (not even sure why I need the Feature Class to Feature Class tool, I just have it there because an earlier thread I was using to build this had that in it). Here is the updated, and simplified model, with the Error Message I am getting. FYI: the Expression in the Calculate Field tool is %Name%

enter image description here


Viewing all articles
Browse latest Browse all 135

Trending Articles