You haven't selected the draped line, it's not highlighted (standard would be thick orange). You've probably still selected and highlighted your polyline that has the elevation set to undefined.
The draped line shows up as "Draped Line" in the properties pane.
But it doesn't show the max/min elevation as a normal stringline. In theory it could, but for this dependent object the programmers obviously thought it's not necessary.
The draped line will update its shape as soon as you change the shape of the original linestring or the shape of the surface.
You can convert it to a normal linestring with the explode command from the Cad-Tab.
Another option would be, instead of creating a "DrapedLine" object with the macro, to create an independent "Linestring" object and use the information which can be retrieved with the Model3D.Profile method. That one is provided by the selected surface itself, we just need to get it as an object.
Add the following code just above failGuard.Commit() and you'll get 2 lines, a dependent "Draped Line" and an independent "Line String".
surface = wv.Lookup(self.entitySurface.SelectedSerial) # we get our selected surface as object
# a PolySeg is an object that contains just the geometry information, it is only used for further computations and has no influence on TBC
polyseg_org = lineEntity.ComputePolySeg() # we get us the horizontal information of the selected line
polyseg_org = polyseg_org.ToWorld() # just in case the line is defined in a UCS we convert it to World
polyseg_draped = surface.Profile(polyseg_org, True) # we use the method Profile that is provided by the surface object to retrieve
# the draped polyseg information, the True lineaerizes the line first, it must be linear anyway
l = wv.Add(clr.GetClrType(Linestring)) # we create a new line object in the world view
l.Append(polyseg_draped, None, False, False) # we fill it with the horizontal and vertical geometry information
# bool useVerticalOverrideIfConstantElevation, bool zeroBecomes2D
# in this case, a draped line on a surface, the polyseg is made up from straight segments, where each segment end
# also has the one and only height information, you can compare that with a standard, straight element, stringline where you don't
# add additional information to the vertical tab
# that's the reason why we have that None there, in this specific case we don't need to add any additional vertical profile information
l.Layer = lineEntity.Layer