Get Center Line at multiple levels

Hi All!

I am looking to get the center line of multiple wall objects extracted from revit with rir.
At each ‘level’ there are the outlines of each wall object in red, I need to extract the center line of the ‘walls’ that are at the perimeter represented by the pink rectangle.

After gathering those yellow curves I am trying to achieve whichever is easier. A single rectangle (orange lines) or individual rectangles (green lines) at each ‘level’

Please let me know if you have any ideas or approaches you think I can use!
Thanks in advance!

2023-06-14_Outline (33.5 KB)

I would start by isolating the lines you care about, like this: (white lines from green group) (48.6 KB)

1 Like

Hi Joseph,

Thanks, would that isolation would work for each ‘level’?
I would need to to the same for each group of curves?

I am trying an approach by selecting the smaller length curve for each ‘wall’ then connect center points but for some reason is not fiving me True for some even when they have the same value.

This would be trying the approach of the green curves from the image I shared in the initial question.

Yes, as you can see by enabling preview on the ColorBa cluster.

I added the white group for the bottom layer, but the same can easily be done for all layers. (51.8 KB)

All layers: (some look a little off, not sure why?) (49.6 KB)

P.S. Posting an image of your GH code is not anywhere near as useful as posting the GH file.
P.P.S. Why Python? Not necessary.

OH! Must set the PxS ‘I’ (Inflate) value to zero. :sunglasses: (51.1 KB)

1 Like

Awesome! thanks, yeah I was trying to implement some python functions here and there to practice haha.
thanks this is very helpful!

I shouldn’t mess with something so simple… (your orange lines in version ‘cc’ above)
But here is a way to get your green lines: (green group) (60.1 KB)

P.S. Add PShift to get them by floor:


1 Like

Thats pretty clever, I was making way too many moves. thanks for this, makes me look at problems with a different approach :pray: