Filter out similar lines

I’m looking to auto-dimension walls (rooms) in a floor plan, but when I use the room outlines, I get double dimensions:


I have been attempting a few things to sort these out (such as tests for length and angle), but those are too crude and get rid of dimensions that I actually want:

Does anyone know of a performant method to fiter out the duplicates?
Dimension interior walls.gh (36.8 KB)

Gets you quite close…

Thanks for the idea!
I ended up figuring the full logic out, it’s quite a convoluted method using closest point with a distance limit and then comparing the length of the curve segments.