4

In ModelBuilder I have a 'search distance' parameter that is a linear unit data type that I am trying to convert to a string so that it can be added to the end of a file's name so the user knows what the selection parameters were for future reference.

I have the file output name set up with in line variables that successfully pass the string parameters along , but not this linear unit type. I also have a calculate values tool that will find and replace the spaces the linear unit outputs. I've tried a simple str(search distance) conversion, but I haven't tried passing the first few characters yet into another variable.

The tool at the top is where I'm getting errors.

  • 1
    You may enter more than 1 inline variable in Calculate Value. You just need a defined parameter for linear unit and I think the linear unit data type behaves like string you can parse with Python (all of which I think you've done but without an illustration I can't be sure). So if your output for Calculate Value is defined as string, you can then add the parsed value you've shown as str(search distance) much like the some of the examples here: pro.arcgis.com/en/pro-app/tool-reference/modelbuilder-toolbox/… – T. Wayne Whitley Jan 27 '17 at 21:51
  • 1
    @T.WayneWhitley if you can add an example or two this may be worth adding as an answer rather than a comment. – Midavalo Jan 28 '17 at 15:57
1

I got it to work by taking the first character of the "Search Distance" Linear Unit parameter and then concatenating the units onto it since I will only be running this selection in meters. I had also forgotten to add quotes around the inline variable when I was converting it from Linear Unit to string. fixed solution

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.