1

I am trying to use inline variable substitution (%Input Feature%) to use the name of an output of a Clip Tool (let's call it "(Final) Output Feature Class) as the name of the output table in the next part of the data model (let's call it "Output Table Name").

I have a workspace defined, and when I call the output of (Final) Output Feature Class using inline variable substitution, it tries to use the entire string as the input name - workspace path and all.

Is there a way to call just the last bit of the string for the table name so I am not using the whole path?

Also - I cannot bring it into Python. I am making ArcGIS specific data models for other users.

enter image description here

4

Try Parse Path:

The Parse Path tool parses the input into its file, path, name, or extension. The output can be used as in-line variables in the output name of other tools.

  • 2
    That is exactly what I am looking for! Thanks! Using "File" for the value I can then link it to the Table to Table tool as the Output Table for its name. – Smithw1 May 8 at 19:41
0

Another solution I found was to create a String variable (let's call it String) using Create Variable within Model Builder's tools. I added this as a precondition to the Clip Tool and as a model parameter to define when I fill out the parameters in the tool.

Then the output feature class of the Clip Tool is set to %Workspace%\%String%, because this parameter is not a model parameter. The Workspace variable, however, is, and becomes defined when the tools parameters are filled out.

Then for the Table Name parameter I use inline variable substitution again with %String% to call String's value to also be used as the Table Name parameter.

This way only sounds slightly more complicated and requires a little more work than the Parse Path tool, but in practice it isn't so bad. Both seem to run about the same.

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.