0

I want create a TIN from point features with elevation using a python script.

This is my script:

import arcpy
from arcpy import env
import json as simplejson
import urllib
import sys,os

arcpy.CheckOutExtension("3D")

env.workspace = r"D:\test\Pythontest"

OutputTin = "PointFTin"
Delaunay = "constrained_delaunay"

arcpy.CreateTin_3d(OutputTin,{},"D:\test\Pythontest\PlotGrid_label_prj.shp"+ "Shape.Ele masspoints", Delaunay)

When I run this script I get this error:

RuntimeError: Object: Error in executing tool

Where is it going wrong?

  • I am having problems figuring this out as well. What does the "ID masspoints FID" stand for as mentioned above? I cannot figure this portion out. I am using ArcGIS 10 and have access to ArcGIS 10.1. The script needs to be a stand alone version. My TIN will be created from a feature class of point data, so in theory that should be "masspoints", but how do I script that out properly? Okay, I finally found an older explanation online that helped out. Thanks, Haskett – user13294 Dec 3 '12 at 22:21
1

Here is a working syntax example of using the Create Tin tool. For geoprocessing tools you can always setup the process in model builder then export the py script, if you are having issues with writing the script.

# Import arcpy module
import arcpy

# Check out any necessary licenses
arcpy.CheckOutExtension("3D")

# Local variables:
New_Shapefile = "New_Shapefile"
tin4 = "C:\\Temp\\tin4"

# Process: Create TIN
arcpy.CreateTin_3d(tin4, "", "New_Shapefile Id masspoints FID", "DELAUNAY")
  • Thanks for the quick replay, you meant to say that first i will create model for that and then from exporting into .py. otherwise not running. yes – user876307 Sep 15 '11 at 11:22
  • @user876307, This is a simple/quick way to put a script together. If it works in model builder than you know the script will work too by it self. – artwork21 Sep 15 '11 at 16:41
  • @artwork21 not necessarilly it will work.. Especially when you use Local variables, that you just dragged and droped in a model. Despite you use workingspace, this tool Create Tin, at least in 9.3 version, requires the full path of variables.. Maye that's already fixed in 10 version.. – najuste Oct 5 '12 at 10:11

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.