HOW TO
In ArcToolbox, a user can 'batch' the Edit TIN process located under ArcToolBox > 3D Analyst Tools > TIN Creation, but the user will not have any control on setting the Edit TIN parameters such as height_field, tag_field, SF_type, and user_z for input layers. Instructions provided describe how to run the Edit TIN tool in the batch mode, by setting the Edit TIN parameters for input layers.
Code:
# Import system modules
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Check out any necessary licenses
gp.CheckOutExtension("3D")
# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/3D Analyst Tools.tbx")
# Find only TIN datasets
gp.workspace = "C:\\WorkSpace\\TINs"
# Get a list of TINs in the workspace.
datasets = gp.listdatasets("", "TINs")
datasets.reset()
dataset = datasets.next()
try:
while dataset:
ds = gp.workspace + "\\" + dataset
#For accessing different FCs under different subfolders
# List all folder workspaces in the current workspace
ws = "C:\\WorkSpace\\FCs\\" + dataset
print "3: " + ws
gp.workspace = ws
print "4: " + gp.workspace
# Get a list of feature classes in the workspace.
fcs = gp.ListFeatureClasses()
# Loop through the list of feature classes.
fc = fcs.next()
while fc:
print "5: " + fc
print "6: " + gp.describe(fc).ShapeType
type = gp.describe(fc).ShapeType
#Only three types of feature types are considered for this Edit TIN process, a point, a polyline and a multipatch
if type == "Point":
pointFC = ws + "\\" + fc
print "7: " + pointFC
elif type == "Polyline":
lineFC = ws + "\\" + fc
print "7: " + lineFC
elif type == "MultiPatch":
multiPatchFC = ws + "\\" + fc
print "7: " + multiPatchFC
fc = fcs.next()
print "1: " + ds
# Edit TIN parameters are hard-coded below that could be changed according to application needs
gp.EditTin_3d(ds, pointFC, " shape shape masspoints true;", lineFC, " shape shape softline true;", multiPatchFC, " shape shape # true")
pointFC = ""
lineFC = ""
multiPatchFC = ""
print "TIN " + ds + " finished!"
gp.workspace = "C:\\WorkSpace\\TINs"
dataset = datasets.next()
except:
print gp.getmessages(2)
Get help from ArcGIS experts
Download the Esri Support App