0

I am trying to run a script to create a polygon layer in a gdb and keep coming up with this error -

Traceback (most recent call last): File "I:\GIS Data\ArcToolBox\SiteBoundaryCreation_FMG_Format.py", line 87, in polygon.created_date = surveyStartDate < --- this is the line the error refers to

File "d:\programs\arcgis\desktop10.3\arcpy\arcpy\arcobjects_base.py", line 35, in __setattr__return setattr(self._arc_object, attr, ao)

RuntimeError: ERROR 999999: Error executing function.

Failed to execute (SiteBoundaryFMG). Failed at Tue Aug 28 16:12:43 2018 (Elapsed Time: 3.35 seconds)

The following section of code is where line 87 sits -

#new variable Polygon.  Set it to create a new row in variable areacur (defined on Line43) at the cursor point (set in areacur)
polygon = areacur.newRow()
#set the shape property of the polygon variable to pntarray (which was set on line 107)
polygon.shape = pntarray
#set the various field to variable defined and assigned above
polygon.Site_Name = siteID
polygon.Site_Type = primT
polygon.Date_created = surveyStartDate **<-- this is the line the error refers to**
polygon.Project = projectName
polygon.Survey_ID = surveyIDName
polygon.created_user = userName
polygon.created_date = userCreatedDate

is it something to do with the name in the line? or is it unrelated? the line the error is referring to is an optional field when using the tool in the arcmap toolbox (see attached image - Survey Start Date (Optional)). would this have something to do with the error? enter image description here

  • Sorry i thought i had - did you need the _base.py script aswell? – CatAAI Aug 28 '18 at 8:56
  • Why your traceback is different than the posted code (polygon.created_date = surveyStartDate vs. polygon.Date_created = surveyStartDate)? Try commenting out this line to see what it does. The field might be non-nullable, it might not be a date field or the datetime construct might be problematic if it is a date field. That's whay @BERA asks for the other relevant part of SiteBoundaryCreation_FMG_Format.py. – fatih_dur Aug 28 '18 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.