Auto dimension for vertical clearance

Hi everyone. I would need some help regarding this dimensioning vertically. the points are numbered not in order so the dimensioning are going in different direction instead of having a 90 degree connection between two points


AUTO DIMENSION.gh (6.6 KB)
AUTO DIMENSION.3dm (139.4 KB)

are the top surfaces exact copies of the lower ones? If so I would set it up in gh, something like this:


AUTO DIMENSION adjusted.gh (11.0 KB)