import arcpy from arcpy import env env.overwriteOutput = 1 env.workspace = r"C:\Default.gdb" fc = "lines_buffer" with arcpy.da.SearchCursor(fc, ["Elevation"]) as cursor: for row in cursor: vertexElevation = row[0] arcpy.MakeFeatureLayer_management(fc, "lines_lyr", "Elevation = " + str(vertexElevation)) arcpy.Adjust3DZ_management("lines_lyr", "NO_REVERSE", vertexElevation)
Hi Joe,
The following workflow should work:
1. Add a field of type Double called 'Elevation' to your lines feature class
2. Right-click on the field > Calculate Geometry > Max (or Min) Z of Geometry
3. Run the standard 'Buffer' tool on the lines feature class. Before executing the tool, be sure to go to the Environment Settings > Z values > 'Enable' Output has Z values
4. The output will contain the 'Elevation' field. Using the below python code, you can iterate through each polygon and adjust the Z value using this field's value:import arcpy from arcpy import env env.overwriteOutput = 1 env.workspace = r"C:\Default.gdb" fc = "lines_buffer" with arcpy.da.SearchCursor(fc, ["Elevation"]) as cursor: for row in cursor: vertexElevation = row[0] arcpy.MakeFeatureLayer_management(fc, "lines_lyr", "Elevation = " + str(vertexElevation)) arcpy.Adjust3DZ_management("lines_lyr", "NO_REVERSE", vertexElevation)