from your description I presume you want to get points on a face or edge of a "real / modelled" Element.
In that case you'd be better off using the Selection.PickObject() method and use the globalPoint of the returned Reference.
Selection sel = uidoc.Selection;
Reference res = null;
try{
res = sel.PickObject(ObjectType.PointOnElement ,new MySelectionFilter(),"pick a point on an element");
}
catch{}
XYZ point = res.GlobalPoint;
These points are not dependent on the workplane, so the distance is point1.DistanceTo(point2);
The method uses a SelectionFilter, so you can narrow the picked point to certain Elements.
A SelectionFilter that accepts all Elements is:
public class MySelectionFilter : ISelectionFilter
{
public bool AllowElement(Element elem)
{
return true;
}
public bool AllowReference(Reference refer, XYZ pos)
{
return true;
}
}