Combining a buildings list and sites list

hi,
so I have a neighborhood in rhino, with a group of buildings.
each building sits on a lot, and i selected each building and made a group. did the same for the lots.
now I want to create a list which will show me a building with his lot.
my problem is it that the order of the buildings list are not the same as the lots list.
how can i rearrange the lists so they will match?

the site

the mismatch.
thank you

You could look for the closest plot to a building or the closest building to a plot (doesn’t really matter). Just need to be able to extract a point location from each.

Good luck,

Sash

that amazing! thank you so much!
however, I have 428 buildings, and 387 plots, so some plots contains several buildings, and
by doing so, its delete the extra buildings… I have tried the closest points, but it didn’t help.

example for the plot with several buildings. the green one is the only one Appears in the end.

If you posted your geometry it would be easier to show you how.


2 Likes

ok, first of all,
you right, I should have mention the numbers before, I’m sorry.
the image you gave doesn’t make sense to me right now.
is the componet isequal come from a plugin? I used a reguler equelsT,
its need to compare the A with B, but you didn’t gave it any input…

I don’t want numbers or images, I want a GH file with your geometry internalized.

buildings and plots.gh (3.2 MB)

White plots are empty, blue plots have one or more buildings. Green group is a list of buildings for each plot, one plot per branch. Empty branches are empty plots.


buildings_plots_2020Dec23b.gh (3.3 MB)

P.S. Move the ‘Jitter’ slider toward 1 to differentiate the buildings by plot.

P.P.S. This looks like a big building straddling three plots? (magenta building with two “wings”)

And it’s not the only one.

1 Like

Alright, so by using ClosestPt - you are looking for the closest point from P in a list of Points C - when working with different sized lists there are a few things to consider.

If you supply 40 points to P - You will get 40 points back out like so:

This is because once it found the 40 points, it doesn’t need to look for anymore and it ignores the rest of the points in our original list of 100.

If you supply 100 points - You will get 100 values back, so see the inputs swapped:

Because it has to find 100 closest points in a list of 40 points, you can see that some of them are selected more than once and lead to the same “plot” from multiple locations. Which I believe should answer your question BUT…

You probably don’t want to select the same plot 5 times if it has 5 buildings and this is where you will split the data into branches - First use CreateSet to get all the unique indices that appear in the list, you can then use list item to sort your shorter list according to what order they were returned from the output of ClosestPt (blue ListItem) you will see that the first item is going to be related to the first building now

Next we have to find out where each of those indices appears, we use create set again to understand all the movements that happened to create the Map of the first set and by using MemberIndex we get the indices of all the unique items from the original list (red ListItem) which are now placed on the branches which correlate to the appropriate plot - so now Branch 0 is all the buildings closest to plot 0 and so on.

Though I see you fellas started sharing files and got some exciting approaches to this already, those are some funky clusters Joseph!

You have ten buildings that aren’t sitting on a plot (red), 196 buildings that straddle two or more plots (yellow) and 222 buildings that sit cleanly on just one plot (green), perhaps shared with other buildings.


buildings_plots_2020Dec23c.gh (3.3 MB)

You can disable PShift in the white group and enable preview on the ColorB component to see the buildings as before.

The cyan group sorts the buildings by XYZ which is not necessary at all, it just made it easier to find small buildings when arranged in a predictable order (using my ‘Tree/List Viewer’ tool).

The white plots are supposed to be empty but some are not due to the yellow buildings in the first image that straddle two or more plots. I don’t yet have a list of plots for those cases or a way to mark plots as used when the building(s) on them are mainly on adjacent plots. Can you finish that part?

ok, first of all, I’m overwhelmed by the sheer amount of your investment in the code.
thank you both!
I need time to fully understand your codes and how I can to modify them, but it Definitely helps me so much in the process.

thank you!

I removed the XYZ sorting from the cyan group in this version, which makes no difference at all until you use the ‘Tree/List Viewer’ tool. Then you might have a hard time finding the highlighted branch so you may want to copy the bits added above the white group into the previous (sorted) version.


buildings_plots_2020Dec24a.gh (52.6 KB)

As shown, Crv in the gold group is passing the output of PShift to both the text panel and the ‘Tree/List Viewer’. Branches with more than one curve are buildings that straddle two or more plots (196). Empty branches are buildings without plots (10). All the others with only one projected curve per branch are buildings confined to one plot (222).

The ‘path idx’ slider shows branch {0;0} which is the first building in the list. It straddles three plots.

NOTES:

  • The three Preview components in the white group (red, yellow and green) have been disabled (hidden) so you can see the ‘Tree/List Viewer’ output.

  • The Buildings and Plots are not internalized to keep the file small. Use the geometry you already have.

  • In the gold group, connect the Branch output to the Crv input to see a data tree of only the buildings that use two or more plots.