1

I have a model that uses the Feature Class to Feature Class tool. It needs 3 inputs (Input layer, location and output name). My goal is that a user would choose a layer, the model would create a new name based on the layer, and then it would export the layer to somewhere else. For testing purposes, the input layer is static, because I have no issues with that part. Here is my model so far:

enter image description here

The change name is a custom tool that take a layer name, and return a string. Again, for testing purposes, I deleted almost all the code, and left only the important part:

import datetime   
import arcpy   
import os  
name = arcpy.GetParameterAsText(0)  
text = "lol"  
arcpy.SetParameterAsText(1, text)

Of course, on the tool properties, I made sure that the data type is a string for the output. I also tried Any type, and also tried changing the type to from Derived to Optional and Required.

But I always get the same error. Output Feature Class is not valid on the Feature to Feature tool: enter image description here

and

enter image description here

I'm not sure what I'm doing wrong.

0

There is some sort of bug in ArcPro. The work around is this:

  1. Make the script output "Desired Name" a precondition to the FeatureClass to FeatureClass tool. Do not connect it to the parameter.
  2. Open the FeatureClass to FeatureClass tool and type into the Output Feature Class Parameter %Desired Name%.

That worked for me.

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.