Help Creating TIN with Python Script

2597
3
Jump to solution
12-04-2012 01:48 PM
GeorgeHaskett
Occasional Contributor III
Hello,



For some reason when I cannot get the following script to work:



# Import primary modules
import arcpy, sys, os, traceback
from arcpy import env

# Set Variables
inTinA_features = arcpy.GetParameterAsText(0)
out_TinA = arcpy.GetParameterAsText(1)
spatial_ref = arcpy.GetParameterAsText(2)

# Create TIN
arcpy.CheckOutExtension("3D")
arcpy.CreateTin_3d(out_TinA, spatial_ref, "inTinA_features Elev_Obs masspoints <None>", "DELAUNAY")
arcpy.CheckInExtension("3D")

The script was stripped down to the bare bones, but still is not functioning.
I am using Python 2.7 with ArcGIS ArcInfo 10.1.

The error I get is as follows:

Traceback (most recent call last):
File "C:\Users\George\Documents\ArcGIS\v2\ProGIS_Project\createTIN.py", line 11, in <module>
arcpy.CreateTin_3d(out_TinA, spatial_ref, "inTinA_features Elev_Obs masspoints <None>", "DELAUNAY")
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\ddd.py", line 1683, in CreateTin
raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000800: The value is not a member of <None>.
Failed to execute (CreateTin).

Failed to execute (createtin).



Thanks in advance,



Haskett
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
GeorgeHaskett
Occasional Contributor III
Thanks,

I finally managed to figure out my multi day headache.  Its all due to typos on ESRI's website in their help section none the less.

In two different examples they use string values, not variables or boolean, but text words such as :

[INDENT]"constrained_delaunay"
"Delaunay"[/INDENT]

The Data Type actually needs to be Boolean and therefor either a True or False.....

Thanks,

Haskett

View solution in original post

0 Kudos
3 Replies
DanielAbera
New Contributor III
Hello, 

  

For some reason when I cannot get the following script to work: 

  

# Import primary modules
import arcpy, sys, os, traceback
from arcpy import env

# Set Variables
inTinA_features = arcpy.GetParameterAsText(0)
out_TinA = arcpy.GetParameterAsText(1)
spatial_ref = arcpy.GetParameterAsText(2)

# Create TIN
arcpy.CheckOutExtension("3D")
arcpy.CreateTin_3d(out_TinA, spatial_ref, "inTinA_features Elev_Obs masspoints <None>", "DELAUNAY")
arcpy.CheckInExtension("3D")
  

The script was stripped down to the bare bones, but still is not functioning. 
I am using Python 2.7 with ArcGIS ArcInfo 10.1. 
  
The error I get is as follows: 

Traceback (most recent call last):
File "C:\Users\George\Documents\ArcGIS\v2\ProGIS_Project\createTIN.py", line 11, in <module>
arcpy.CreateTin_3d(out_TinA, spatial_ref, "inTinA_features Elev_Obs masspoints <None>", "DELAUNAY")
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\ddd.py", line 1683, in CreateTin
raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000800: The value is not a member of <None>.
Failed to execute (CreateTin).

Failed to execute (createtin).



  
  

Thanks in advance, 

  

Haskett




I think the problem is in the input values : [ ...[in_feature_class, height_field, SF_type, tag_value],...] . Since the input feature class, height field, and other optional values should be inputted as one value within a quotation, try first to use the input feature class as hard coded like C:\testFeat.shp. Then if you have to use the input Feature class as variable, use a code somthing like this ( reference: ArcGIS 10.1 help section)

arcpy.ddd.CreateTin(outTin, sr, "{0} Elev_Obs masspoints <None>", "Delaunay")

{0} - mean the first input parameter.
0 Kudos
GeorgeHaskett
Occasional Contributor III
Thanks,

I finally managed to figure out my multi day headache.  Its all due to typos on ESRI's website in their help section none the less.

In two different examples they use string values, not variables or boolean, but text words such as :

[INDENT]"constrained_delaunay"
"Delaunay"[/INDENT]

The Data Type actually needs to be Boolean and therefor either a True or False.....

Thanks,

Haskett
0 Kudos
ShaunWalbridge
Esri Regular Contributor
At least at 10.1SP1, this issue is resolved, and you can safely use "DELAUNAY" or "CONSTRAINED_DELAUNAY" as the keywords, and any other value will return an error.
0 Kudos