Hi Erin,Do the pipelines with relative heights correctly connect at the start and end points? If not then adding the DEM information will not correct anything. Adding an average height for a line will create these kind of errors. What you need is to distinguish between "from" and "to" height (DEM elevation) for each polyline and use the "Feature To 3D By Attribute (3D Analyst)". To do this you could follow these steps:Create points at From and End point with the tool "Feature Vertices To Points (Data Management)" using the point_location = "BOTH_ENDS". This requires an Advanced (Arc/Info) license.If you don't have Arc/Info you could use some Python code like this:import arcpy, os
# featureclasses
polylineFC = r'C:\Path\To\Your\filegeodatabase.gdb\Pipelines' # edit this!
fldID = "NameOfYourUniqueIDfield"
# outputs
outWS = r'C:\Path\To\Your\filegeodatabase.gdb' # output workspace
outFromNodes = 'FromNodes' # output names
outToNodes = 'ToNodes' # output names
# Set local variables
geometry_type = "POINT"
has_m = "ENABLED"
has_z = "ENABLED"
# Use Describe to get a SpatialReference object
spatial_reference = arcpy.Describe(polylineFC).spatialReference
# Execute CreateFeatureclass
arcpy.CreateFeatureclass_management(outWS, outFromNodes, geometry_type, polylineFC, has_m, has_z, spatial_reference)
arcpy.CreateFeatureclass_management(outWS, outToNodes, geometry_type, polylineFC, has_m, has_z, spatial_reference)
# make nodeDict polylines
featuresFrom = []
featuresTo = []
lstIDs = []
curF = arcpy.da.InsertCursor(outWS + os.sep + outFromNodes,("SHAPE@", fldID))
curT = arcpy.da.InsertCursor(outWS + os.sep + outToNodes,("SHAPE@", fldID))
with arcpy.da.SearchCursor(polylineFC, ("SHAPE@", fldID)) as cursor:
for row in cursor:
polyline = row[0]
uniqueID = row[1]
pntF = polyline.firstPoint
pntT = polyline.lastPoint
curF.insertRow((pntF,uniqueID))
curT.insertRow((pntT,uniqueID))
del row
del curT
del curF
Use the output feature classes to extract the DEM values to the points.Create in the pipes featureclass the fields "FromHeight" and "ToHeight". Join both the point featureclasses to the pipes featureclass based on the unique ID field. Fill the "FromHeight" and "ToHeight" fields with the field calculator. Apply the relative height to obtain the absolute height for from and to points of the pipes.Now you can use "Feature To 3D By Attribute (3D Analyst)" using the "FromHeight" and "ToHeight". If pipes share a from/to point the height will be the same at that point IF the relative height for the pipes is the same.Kind regards,Xander