Selecting Grids by Columns

When you move a grid line the columns move with it, so that makes it appear as those there is some link there.

Is there a way to select all the grid lines based on a column selection?

We have different column types based on where they start and finish, but we only have one grid type. I’m wanting to create different grids that match the column types. So my thought is to use the columns to select the grids that are linked to them instead of selecting the grids individually to change their type. I used the snoop tool on the grids and didn’t see any connection to a column type.

You’d have to define/determine the relationship between column type and grid type and then use that to locate grids that intersect those column types.

Once you have the relationship figured out we can give better feedback.

Yeah, I was hoping someone would maybe know a link that I wasn’t seeing. I would imagine if it can’t see a connection when using the Revit Lookup tool then it’s probably not doable.

Columns have a ‘grid’ parameter; I can’t recall what it is exactly, but I think it might be ‘Location Mark’ which is a calculated built-in parameter so it should always exist and always be correct. This will contain the two grids, but you will have to extract them from the string.

So…

  1. Start by getting all columns.
  2. Group the columns by type.
  3. Get the ‘Location Mark’ for each column.
  4. Pull the grid names from the resulting string. You should have two lists with two sublists at this point.
  5. Get all the grids.
  6. Get the name of each grid.
  7. Build a dictionary with the grid names as the key, and the grids as the values.
  8. Get the column from the dictionary using the lists of names from step 4.
  9. Set your ford types as needed. Note if you have a grid in two lists (possible if not likely) the last item in the list wins.

I misunderstood your question. As Jacob mentioned, the Column Location Mark handles all that internally (I don’t think there’s a way to get the actual grids, just the name) but is only available to Structural Columns.

Never understood the difference between the two :slight_smile:

I think it’s mostly this functionality right here. Structural columns are typically defined by the structural column gridlines, so they auto-lock to grids and associate with a grid intersection. This allows them to be controlled by the grids instead of individually. Architectural columns are just “for show” and so they would be controlled by other references if at all.

Very little scripts here on the Forum to change one for the other though.
Probably a relic

I think there’s just very little cross-over between those who would use both.

Thanks for this! I’m having trouble with the final steps. I have the columns grouped by Type, the Column Location Mark list, and the Dictionary of the grids.

What I think I need to do is to use the dictionary to select all the grid lines associated with the column types I grouped, but I’m not sure how to do that. You say to pull the string from the location marker, but how do you do that?

I think this should be a clearer screenshot

I went back to my videos From John Pierson and I think I need to use the Dictionary.ValueatKey node, but I need the string from the location marker parameter. This was my question earlier.

Try the StringFromObject node

That doesn’t work because when I pull the column location marker parameter it is already a string, so I’m not sure how to pull the grid name from the string.

Can you show a sampling of the parameter values as they are read?

These are the column location marks that are pulled from the first column type in the list.

I like my dictionaries with Id’s and strings from a parameter, as these Locations are unique
Get key will give me the Id, and go from there

First column is associated to H.9 and Y.6.
Second is C.1 and 10.3.
Third at C.1 and…
Fourth at…

So you need to strip out anything inside a parenthesis, and then split the string at the dash.

One method for this would be using a regular expression in Python. I suggest you look into that - there are a lot of uses and you can apply this elsewhere.

Another would be to utilize Dynamo’s string tools. String.AllIndiciesOf will get you the indexes of the start and end parenthesis, and you can use those and the string length to find which characters to drop via some String.SubString nodes. Then use the String.Split to divide the first and second grid names.

Thanks for the help. Here is what I ended up with and it seems to be working.