Best Way To Check If Column Has Continuis Element Floor Above/Below. Continuis Element Could Be Column Or Wall

I am looking to write a script that checks if a selected column has a continuation on floor above (or bellow. To do with placing rebar accordingly).
The best way I am thinking about is to check if there is an element intersecting the floor above/below the column at the position of the column. If there is so select that element and treat it accordingly. I understand that there is a location method but I never came across it, so if you are familiar with it, am I in the right direction?
Do you have any other ideas of how to check if there are continuing elements from a given column?
Thanks ahead of time.

“Element.GetLocation” is the node you require. Note that columns will report either curve (typically inclined columns) or point based (typically vertical). Gather your point locations and column parameters to group by locations taking into consideration a tolerance for shifting/walking columns. Then sort your groups by z elevations. The resulting data should be a list of each column run sorted from low elevations to high elevations. You could achieve this via a combination of geometry/bounding intersects as well but unless you are the one modeling the columns you will likely find inconsistent results.

1 Like

Thanks! I’ll try it out.

With python and the revit API there are several ways to achieve this. Off the top of my head here are a few…

  • Check if column element has attachment with another element at a given end. Quickest test, but depends on user attaching columns to target elements so not overly robust. See ColumnAttachment class in API docs.
  • Get columns swept profile driving curve (rather than location as columns can be either point or curve based). From this, test for other elements where the bounding box contains this point with bounding box contains point filter (and/or bounding box intersects filter) and then do any further tests to see if this element is a suitable candidate (with floors, you can get top and bottom faces with HostObjectUtils and if this point lies on the face), other element types will require a different strategy.
  • Check of column swept profile driving curve intersects a solid and test how many segments outside the solid were encountered. Again, you can filter the candidate elements either by bounding box intersects filter or bounding box contains point filter to make the test a lot faster.
  • Raycasting method by shooting a Ray (see ReferenceIntersector class in API docs) from top and bottom of the column to see what you intersect. You can test distance and get elements from this method but it does require you to pass a 3D View from which to do the raycasting and if some elements are hidden in the view the intersector won’t find them.
1 Like

Thanks Daniel! Most of these methods I haven’t yet got to use or come across but I will definitely try to research it and check it out.

No problems! Good luck, and if you get stuck then come back here! :blush:

1 Like

Hey zvith :slight_smile:
I have a script that creates views of all selected columns, place families, rotate views,sort the views, etc, with the following result:


I´m also placing tags on the columns above, if there are columns above.
I´m checking if a column is above by getting all columns in view and comparing the location.

If you don´t have views, maybe there are node to get all elements inside a boundingbox?! So you could create boundingboxes and look if a column with another z value is inside or not.

That is the direction of what I am trying to do.
I currently got all elements of level above and below, created a bounding box for those elements and am intending to see if any of them intersect with the bounding box of the column.
But there were also other ways suggested so I am intending to try them out as well.

Can you indulge further about getting the column sweep, what method it to use?
What I currently did was get the bounding boxes of all wall/columns on level above/below, copy them to the level of the object and then see if they contain the element’s centroid point - and it works :slight_smile: (although it probably doesn’t fit the scenario of a slanted column…

Yup, sure, you can get the swept profile of a column (or beam or any linear profile based family instance) via this method…

This will give you a SweptProfile object and then you can call GetDrivingCurve() which will return a revit curve, which in most cases will align with location curve unless you have overriden the justification or local offsets.

Be sure to check first though if the column has a swept profile via…