Select to view content in your preferred language

Change geoprocessing tool label using ModelBuilder

200
2
03-20-2025 08:19 PM
Labels (1)
AmyDunn
Occasional Contributor

I have a model in ModelBuilder that I eventually want to run as a tool. The problem I'm having is I have the Contour interval parameter from the Contour tool set and I am also using this as an inline variable to name outputs. If I call it "Contour interval" it shows up nicely in the tool, but when I try and use ContourLines%Contour interval%m_ID to update a field name I get Error 000313: The length of Field Name must not be larger than 31. Even though the interval will never be more than 3 digits. If I shorten the variable name to ConInt it works, but then it shows up in the tool as ConInt and I want the full text of "Contour interval". 

On the Parameters tab of the Tool Properties for the model I can see each parameter has a Label and a Name, but I can not find anywhere that lets me edit these.

Is there a way to change this in ModelBuilder?

0 Kudos
2 Replies
John_S
by
Frequent Contributor

I don't know if there's a way to do what you're specifically asking for or not... but I can give you a work-around that should help.  So, you create an input variable of the appropriate type called "Contour interval" and make it an input parameter so it shows that way to the end user in the tool options.  Then, you add the Calculate Value GP tool and have it be an extremely simple script that takes the "Contour interval" and returns it as it, with the Calculate Value ouput parameter named "ConInt".  Then you effectively have 2 separate parameters that will have the same value but with different names, so the long one can be shown to the end user and the shortened one can be used with inline variable substitution.  I know it may complicate the model slightly, but it in theory should do the trick...  Hope it helps.

0 Kudos
AmyDunn
Occasional Contributor

I tried this and it partially worked, I was still able to use the %ConInt% inline variable to name the scratch contour output feature class, rename an existing feature class, and change a field name, but when I went to append the contours to the newly renamed feature class it kept trying to find ContourLines1ft and threw an error when that didn't exist because I had set 80 as my contour interval. I could not figure out where it was getting the 1 from.

0 Kudos