Error 00075 Input Features Value is Required

884
9
08-04-2011 03:06 PM
PeteVitt
Occasional Contributor III
Hi - I've got a python script that takes four points and makes a shapefile.  I've put the script inside a model and want it to provide the input to a Minimum Bounding Geometry Tool.  I've created a derived output parameter in the script that provides the input, but I get the subject error when I run the model -- the part of my code where I try to generate the output parameter is:

ptFile = gp.CreateFeatureClass_management(outFolder, outFile, "Point", "#", "#", "#", sr)
.....
arcpy.SetParameterasText(0, ptFile)

the script runs fine on its own, and creates a shapefile, but somehow this output parameter is not getting passed to the Minimum Bounding Geometry Tool

Attached is a screen shot of my model
Any ideas about what I'm doing wrong?

Thanks
0 Kudos
9 Replies
ShitijMehta
Esri Regular Contributor

  • Try running your script tool with all the input values once and save the model.

  • Now connect the output of the script tool to the next tool.

  • Make sure that the feature type that your script tool is creating is an accepted as a valid input type for the next tool.

  • Remove all the previously added input values from your script tool parameters to make the tool a generic tool once again.

0 Kudos
DaleHoneycutt
Occasional Contributor III
You may be setting the wrong parameter with SetParameterAsText.  You have 8 input parameters.  Your derived output should ALWAYS be the last parameter.  Therefor, you should be doing SetParameterAsText(8, ptFile).  Also make sure that ptFile has a valid value (i.e., add a message to check its value).
0 Kudos
PeteVitt
Occasional Contributor III
the error is definately occuring at:
arcpy.SetParameterAsText(8, ptFile)
as I've added a Message below this line and the script jumps to the exception -- is there any way to get a description of the error exception?  Its very odd because the shapefile gets created successfully

Thanks

Pete
0 Kudos
ShitijMehta
Esri Regular Contributor
Can you share your model/script tool?
0 Kudos
DaleHoneycutt
Occasional Contributor III
Here's a blog post on getting error descriptions.  It may help you to debug.
0 Kudos
PeteVitt
Occasional Contributor III
Here they are
0 Kudos
PeteVitt
Occasional Contributor III
uploaded wrong script on previous post -- this is it
0 Kudos
DaleHoneycutt
Occasional Contributor III
Several issues here:
- You're mixing gp = arcgisscripting.create() with arcpy.  Choose one or the other.  While it's technically feasible to mix them in a script, there are numerous issues that can arise.
- A tool returns a result object.  You were setting the output parameter to this result object and it fails.

Here's a snippet (from your code) that works with arcpy...  Note that I'm using SetParameterAsText.  I tested this in a model and it updates the derived output correctly

arcpy.env.overwriteOutput = True


#sr = gp.CreateSpatialReference("C:\\Program Files\\ArcGIS\\Desktop10.0\\Coordinate Systems\\Geographic Coordinate Systems\\North America\\NAD 1983.prj")
sr = "#"
result = arcpy.CreateFeatureclass_management(r"E:\scratch\scratch.gdb", "Test", "Point", "#", "#", "#", sr)
ptfile = result.getOutput(0)
arcpy.AddMessage("output feature class is: " + ptfile)
arcpy.SetParameterAsText(8, ptfile)
arcpy.AddMessage("Checking: set output parameter 8")
0 Kudos
PeteVitt
Occasional Contributor III
Thank you for your help - it is working now when run as script and in the model
0 Kudos