Select to view content in your preferred language

arcpy.GetParameterAsText not working

720
3
06-30-2012 11:42 AM
StephenFricke
Deactivated User
Hello,
I have recently upgraded to 10.1 and now the a script which I wrote that worked fine in 10.0 is no longer working in 10.1.  It appears there is an issue with getting the GetParameterAsText function.  Here is there error I am getting:

Traceback (most recent call last):
  File "C:\reacch\scripts\clippedRastoGraph.py", line 6, in <module>
    polygon= arcpy.GetParameterAsText(5)
  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\__init__.py", line 592, in GetParameterAsText
    return gp.getParameterAsText(index)
  File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 224, in getParameterAsText
    self._gp.GetParameterAsText(*gp_fixargs(args, True)))
RuntimeError: Object: Error in getting parameter as text

Does anyone have any idea why I am getting this error with 10.1 when everything was completely fine when running the script in 10.0?  Thank you!
Tags (2)
0 Kudos
3 Replies
NobbirAhmed
Esri Regular Contributor
What is the data type of your 6th parameter and what value you are trying to assign it? I would like to reproduce the error locally. Thanks.
0 Kudos
StephenFricke
Deactivated User
I was using a shapefile for the parameter.  I have also tried other parameter types and received the same error.  Let me know if you figure anything out.  Thank you!!
0 Kudos
NobbirAhmed
Esri Regular Contributor
Have you set your parameter as shown below?

[ATTACH=CONFIG]15641[/ATTACH]
0 Kudos