how to get the distance (or altitude) of one object above another

I'm trying to get the height of my ship above the ground (altitude if you like) at the moment I'v tried this

var HeightTXT: GUIText;
var Heighttarget : Transform;
var distance : int;

function Update() {
    var distance = Vector3.Distance(transform.position, Heighttarget.position);
    HeightTXT.text = "height = " + distance;
}

but I'm getting the distance to the center of the object (imagine a big flat plane for the ground) I'm after something like height above sea level, the distance from my ship to the ground plane

If you want just the height from the centre of your object to the ground plane (presumably this is what is stored in your var "Heighttarget"), you just need to compare the Y component of the position variables. Eg:

var distance = transform.position.y - Heighttarget.position.y;

However if your object is of significant size, you might want the distance from the bottom of your object to the ground plane. In this case you can use Renderer.bounds to find the extremities of your object along each axis. In particular, `renderer.bounds.min.y` will give you the lower y level of your object in world space.

Here's an adaptation of your script:

var HeightTXT: GUIText;
var Heighttarget : Transform;
var distance : int;

function Update() {
    var distance = renderer.bounds.min.y - Heighttarget.position.y;
    HeightTXT.text = "height = " + distance;
}

And finally, if your ground isn't a flat plane (eg, hilly terrain), and you want the distance to the ground that's currently under your object rather than the distance to a fixed height (like sea-level), you'll need to use a Ray Cast (either Physics.Raycast or Collider.RayCast) each frame to determine the current height.