+ Reply to Thread
Results 1 to 4 of 4

Thread: Help Creating TIN with Python Script

  1. #1
    George Haskett
    Join Date
    Jan 2012
    Posts
    226
    Points
    41
    Answers Provided
    19


    0

    Default Help Creating TIN with Python Script

    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

  2. #2
    Daniel Abera
    Join Date
    Nov 2010
    Posts
    20
    Points
    0
    Answers Provided
    1


    0

    Default Re: Help Creating TIN with Python Script

    Quote Originally Posted by geohaskett View Post
    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.
    Last edited by dabera; 12-05-2012 at 08:51 AM.

  3. #3
    George Haskett
    Join Date
    Jan 2012
    Posts
    226
    Points
    41
    Answers Provided
    19


    0
    This post is marked as the answer

    Angry Re: Help Creating TIN with Python Script

    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 :
    "constrained_delaunay"
    "Delaunay"
    The Data Type actually needs to be Boolean and therefor either a True or False.....

    Thanks,

    Haskett

  4. #4
    Shaun Walbridge
    Join Date
    Jul 2012
    Posts
    126
    Points
    103
    Answers Provided
    14


    0

    Default Re: Help Creating TIN with Python Script

    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.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts