I am using Reclass within a Code Block in Field Calculator in a Model to calculate field values for a variable based on several other fields.

Using reclass is much quicker than select and then using Calculate Field.

The example below works fine.

enter image description here

This is a simple example of the way i am using this. The typical use references many more fields.

My question is this.

Instead of a hard coded and fixed value i wish to use a user generated Parameter.Therefore I set a new variable named "Buildx", set this as a Parameter. Then i replaced the value of "30" in the code block with %Buildx%. This should work as in line variable substitution, however i get the 99999 error code.

enter image description here

I tried setting the stand alone variable Parameter as either Any Value or as a Long Integer, but neither worked.

I'd be grateful of any advice or ideas.

Error message below - the stand alone variable has been coded as 30, so it appears as 30 in the error message, but results in an error.

enter image description here


It's Python code but your Expression Type in the second screenshot is VB ;)

  • 1
    Ouch, it's the small, tiny insignificant mistakes like this that absolutely drive me insane with ArcGIS! +1 for a good eye! – GISKid Aug 6 '14 at 20:16
  • 2
    An eye trained to spot these tiny mistakes after so many similar ones of my own! – nmpeterson Aug 6 '14 at 20:17
  • oh dear. my mistake. well spotted . yes i changed it to Python and it worked fine. i had not tried to incorporate the in -line variables into the code block before so i just assumed that was the problem.thanks again. – user21053 Aug 7 '14 at 8:20

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.