If the solids are made using extrude command, with a height, not path, then you can extract the height like this:
 
(defun c:test ( / e solid)
  (while
    (and
      (setq e (car (entsel)))
      (setq e (cdr (assoc 350 (entget e))))
      (eq (cdr (assoc 0 (setq e (entget e)))) "ACSH_HISTORY_CLASS")
      (setq e (cdr (assoc 360 e)))
      (eq (cdr (assoc 0 (setq e (entget e)))) "ACAD_EVALUATION_GRAPH")
      (setq e (cdr (assoc 360 e)))
      (setq e (entget e))
      (setq solid (cdr (assoc 0 e)))
    )
    (cond
      ((eq solid "ACSH_EXTRUSION_CLASS")
       (princ (strcat "\nExtrusion Height: " (rtos (distance '(0 0 0) (cdr (assoc 10 e))))))
      )
      ((eq solid "ACSH_BOX_CLASS")
       (princ (strcat "\nBox Height: " (rtos (cdr (assoc 42 (reverse e))))))
      )
      ((eq solid "ACSH_CYLINDER_CLASS")
       (princ (strcat "\nCylinder Height: " (rtos (cdr (assoc 40 (reverse e))))))
      )
      (T
       (princ "\nUnable to extract solid height.")
      )
    )
  )
  (princ)
)
	Doesn't work on edited solids, or modified by a boolean operation. Still, if the section of the solid (section perpendicular to extrusion direction) is a circle or a rectangle, you can find the height with some calculation over the geometric properties.