I am trying to get this tool I've been writing for the past month operational. I think it should all work, but I'm getting caught up on the parameters of the code. Here is the start of the code that assigns the variables/parameters:
I commented out the report line, since it is for testing an idea(failed)
#importing arcpy, system, Tkinter as well as all of Tkinter's functionalityimport arcpy, sysfrom Tkinter import *Convwks_fc = arcpy.GetParameterAsText(0) #assigns the Feature Class to a variable based on user input for use in the toolConvwks_lyr = arcpy.GetParameterAsText(1) #assigns the Feature Layer to a variable based on user input for use in the toolirrdist = arcpy.GetParameterAsText(3)reportlocation = arcpy.GetParameterAsText(4)#report = reportlocation + "\"" + irrdist + "Report.txt"report = r"\\agcifs01\GroupShares\agletirr\BenFerence\Python\Work\ConvwksAttributeValidationB\SMPReport.txt"desc = arcpy.Describe(Convwks_fc)arcpy.env.workspace = desc.pathHere is the error I receive when I attempt to run the code. I had gotten this same error on both of these variables: irrdist = arcpy.GetParameterAsText(3) & reportlocation = arcpy.GetParameterAsText(4).
Executing: ValidateAttributesB \\agcifs01\GroupShares\agletirr\BenFerence\Python\Work\ConvwksAttributeValidationB\SMP2015TEST.mdb\Convwks Convwks SMPStart Time: Mon Aug 24 14:42:46 2015Running script ValidateAttributesB...Traceback (most recent call last): File "\\agcifs01\GroupShares\agletirr\BenFerence\Python\Work\ConvwksAttributeValidationB\Scripts\ConvwksAttributeValidationB.py", line 17, in irrdist = arcpy.GetParameterAsText(3) File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\__init__.py", line 598, in GetParameterAsTextreturn gp.getParameterAsText(index) File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 224, in getParameterAsTextself._gp.GetParameterAsText(*gp_fixargs(args, True)))RuntimeError: Object: Error in getting parameter as textFailed to execute (ValidateAttributesB).Failed at Mon Aug 24 14:42:46 2015 (Elapsed Time: 0.00 seconds)I am passing a simple string to the irrdist variable and a folder location to the reportlocation variable, I don't understand why this error is being raised... Have any of you guys run into a problem like this? What was causing it?
أكثر...
I commented out the report line, since it is for testing an idea(failed)
#importing arcpy, system, Tkinter as well as all of Tkinter's functionalityimport arcpy, sysfrom Tkinter import *Convwks_fc = arcpy.GetParameterAsText(0) #assigns the Feature Class to a variable based on user input for use in the toolConvwks_lyr = arcpy.GetParameterAsText(1) #assigns the Feature Layer to a variable based on user input for use in the toolirrdist = arcpy.GetParameterAsText(3)reportlocation = arcpy.GetParameterAsText(4)#report = reportlocation + "\"" + irrdist + "Report.txt"report = r"\\agcifs01\GroupShares\agletirr\BenFerence\Python\Work\ConvwksAttributeValidationB\SMPReport.txt"desc = arcpy.Describe(Convwks_fc)arcpy.env.workspace = desc.pathHere is the error I receive when I attempt to run the code. I had gotten this same error on both of these variables: irrdist = arcpy.GetParameterAsText(3) & reportlocation = arcpy.GetParameterAsText(4).
Executing: ValidateAttributesB \\agcifs01\GroupShares\agletirr\BenFerence\Python\Work\ConvwksAttributeValidationB\SMP2015TEST.mdb\Convwks Convwks SMPStart Time: Mon Aug 24 14:42:46 2015Running script ValidateAttributesB...Traceback (most recent call last): File "\\agcifs01\GroupShares\agletirr\BenFerence\Python\Work\ConvwksAttributeValidationB\Scripts\ConvwksAttributeValidationB.py", line 17, in irrdist = arcpy.GetParameterAsText(3) File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\__init__.py", line 598, in GetParameterAsTextreturn gp.getParameterAsText(index) File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 224, in getParameterAsTextself._gp.GetParameterAsText(*gp_fixargs(args, True)))RuntimeError: Object: Error in getting parameter as textFailed to execute (ValidateAttributesB).Failed at Mon Aug 24 14:42:46 2015 (Elapsed Time: 0.00 seconds)I am passing a simple string to the irrdist variable and a folder location to the reportlocation variable, I don't understand why this error is being raised... Have any of you guys run into a problem like this? What was causing it?
أكثر...