The script below is slightly modified "Polyline example" from ArcGIS help http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000008000000
import arcpy# next 3 lines are newfrom arcpy import envenv.outputZFlag = "Enabled"env.outputMFlag = "Enabled"# A list of features and coordinate pairs# 3rd presumably Z coordinate added to original pairs of XYfeature_info = [[[1, 2, 1], [2, 4, 2], [3, 7, 3]], [[6, 8, 4], [5, 7, 5], [7, 2, 6], [9, 5, 7]]]# A list that will hold each of the Polyline objectsfeatures = []for feature in feature_info: # Create a Polyline object based on the array of points # Append to the list of Polyline objects features.append( arcpy.Polyline( arcpy.Array([arcpy.Point(*coords) for coords in feature])))# Persist a copy of the Polyline objects using CopyFeaturesarcpy.CopyFeatures_management(features, "d:/scratch/polylines.shp")I try to create 3D polyline and fail. Script creates polylineZ shapefile, but all features are flat with Z=0 at vertices. What is wrong here please?
أكثر...
import arcpy# next 3 lines are newfrom arcpy import envenv.outputZFlag = "Enabled"env.outputMFlag = "Enabled"# A list of features and coordinate pairs# 3rd presumably Z coordinate added to original pairs of XYfeature_info = [[[1, 2, 1], [2, 4, 2], [3, 7, 3]], [[6, 8, 4], [5, 7, 5], [7, 2, 6], [9, 5, 7]]]# A list that will hold each of the Polyline objectsfeatures = []for feature in feature_info: # Create a Polyline object based on the array of points # Append to the list of Polyline objects features.append( arcpy.Polyline( arcpy.Array([arcpy.Point(*coords) for coords in feature])))# Persist a copy of the Polyline objects using CopyFeaturesarcpy.CopyFeatures_management(features, "d:/scratch/polylines.shp")I try to create 3D polyline and fail. Script creates polylineZ shapefile, but all features are flat with Z=0 at vertices. What is wrong here please?
أكثر...