I’m not entirely sure whether what I want to do is actually doable or if it sits just outside my knowledge.
I’m working on a VERY complex project, with several different locations and parameters associated with the level name, area of the project, zone, etc. These parameters are currently all defined in a model that’s just masses. There are 800+ masses.
I want elements modelled in my Revit file to inherit parameter values based on if their centroid falls inside one mass or the other.
What I managed to do for now is the following:
In the first part I get the masses from the linked model, and extract the 4 parameters regarding the mass location inside the project.
Then I get all the masses geometry and their bounding boxes.
On the other hand, I get the centroid of every element in my model.
Cross check all the centroids against all the bounding boxes, to see which one falls inside which one.
What I still need to figure out, is how to tell dynamo to apply the corresponding parameters from the mass but only if the centroid falls inside that bounding box.
Any ideas?
Thanks!
Certainly doable - pull the solid geometry of the masses with an Element.Solids and union each of the lists into a single solid.
Use a Geometry.DoesIntersect node to find which element center points intersect with which mass. The result shoudl be a list of lists of boolean values - one list of booleans for each Revit element, with a boolean for each mass element.
Use a List.FilterByBoolMask node to filter out the mass elements (not the geometry) which the point does not intersect. You now have a mass element for each revit element - pull and set parameters as desired.
A few things to note which you’ll eventually need to account for:
- What will you do when (not if) a centroid falls on a face of two masses?
- What will you do when a centroid is not on the element (think of a curved pipe, the centroid is not on the element’s geometry and therefore you may find mass A when the entirety of the wall doesn’t touch mass A as it wraps around the mass (and should be in mass B accordingly)
- As you have 800 masses (and I’m assuming a lot of Revit elements), running this across the entire model will be slow. You may want to look at selecting things by quadrant/view to reduce the scope of any particular run.