# -*- coding: utf-8 -*- #by gisoracle 2021.01.23 import arcpy import math #保存数据 def Save(polygon,rows): row = rows.newRow() #row.setValue(shapefieldname,featureList) row.shape=polygon rows.insertRow(row) del row outFeature=arcpy.GetParameterAsText(0) x=500000 y1=0 r=200.0 y2=500 rows = arcpy.InsertCursor(outFeature) array = arcpy.Array() p1 = arcpy.Point(x - r, y1, 0) array.add(p1) p1 = arcpy.Point(x + r, y1, r/4) array.add(p1) p1 = arcpy.Point(x + r, y2, r/2) array.add(p1) p1 = arcpy.Point(x - r, y2, r*0.75) array.add(p1) polygon = arcpy.Polygon(array, None, True) Save(polygon, rows) polygon = None