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?
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.
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.
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âŚ
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.
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:
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.
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.
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.
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.
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.