Hi juraj,
Your problem seems to be "dimension" don't want mesure in certain zone of 3D view like a perp Z.
But with another zone it's seems possible.
An easy way is to do a "BooleanUnion" to have an edge. Then select your edge to know its dimension.
Of course you can next undo your BooleanUnion

|