I’m trying to do something that should in theory be quite simple.
I have a 35 storey tower with a fairly uniform floor plan for level 1 to 35.
The columns in the project are numbered uniformly based on their location. These numbers are added as “Mark” to the object properties.
These values are only added on the first floor, and should be repeated on all other floors.
In essence I want to do the following steps:
- Select columns on 1st floor (This set of columns we can call C1)
- Retrieve their coordinates
- Select all other columns (C2)
- Retrieve coordinates for C2
- Compare coordinates of columns in C1, against columns in C2
- Find matching sets
- Apply the “Mark value of columns in C1 to their matching pairs in C2.
The first list C1, will be our reference list. The set of columns from which we want to write the “Mark” value to other columns.
The second list, C2 contain many more columns in multiple floors. These are the columns we need to find a matching column for from C1. There may even be cases that a column in C2 does not have a matching column in C1, and there will indeed be cases where multiple elements in C2, are matched to a single element in C1.
This is how I have done the following steps in Dynamo, and where I am stuck at the moment:
I have selected all columns on level 1. In this case there are 30 elements.
I take the location of the columns and round them to avoid any minor modelling errors. I then create a string of this. I found that this will be crucial for comparing the lists later on:
I have selected all the other columns in the project. In this case there will be 1412 elements:
Before getting the coordinates of the columns in C2, I need to exclude all slanted columns, which due to their geometry cannot be included in this script, because their XY coordinates change at the start and end of the columns. After filtering out the slanted columns the number of elements in C2 is reduced to 1396:
Afterwards the coordinates are rounded up as in Step 2, and converted into a string which will allow us to make the comparison later on:
Step 5 & 6:
This is basically where I get stuck.
I compare the two lists against each other getting the following list with cross-product lacing.
I am not sure how to use these lists to complete step 7.
Is anyone able to help?