How to Designating Elements Based upon Arbitrary Zones/Areas

As of late I have developed a number if DYN’s that essentially have all boiled down to one string of operations:

  1. Grab all elements of Category/Type
  2. TRUE/FALSE dependant upon whether or not the element is located within a predefined arbitrary Zone
  3. If FALSE: Do Nothing
  4. If TRUE: Set Element’s Parameter Value to [new value]

I thought it may be useful to start a thread with the intent to discuss the various ways you can complete these operations using Dynamo.

Initially I had simply created various Views that were cropped down to the dimensions of the intended ‘Area/Zone’. I would utilize the views by using the ‘[get all elements of type in view]’. This worked great until I reviewed the resulting content.

All of my zones are neighboring at least two other zones. This created an issue when elements crossed from one zone to another zone. My script would end up selecting the same element twice with each run of the script. Below is a visual example of this happening, the dashed line is the Northern border of one Zone and the Southern border of another Zone.

I had actually utilized this revision of my script for a while, but eventually the lack of accuracy had bugged me too much. So I wanted to improve this aspect.

I utilized Bounding Boxes, specifically the Bounding Box’ Centroid.

I configured the dimensions of the Zones’ Views via Scope Boxes in Revit, then I would apply the appropriate Scope Box to each View (under the Views’ “Extents” category of Parameters.) I found that I can translate a Revit Scope Box into a Dynamo Bounding Box.

Using the “BoundingBox.Property” Node from the Clockwork package, you can visualize the Centroid of any Bounding Box, among other things. You can also utilize the “BoundingBox.MidPoint” Node (Springs Package) to output only the MidPoint (Centroid) of a Bounding Box. The later is the method I settled upon.

After retrieving the Centroids of Selected elements I was able to then feed those [Points], and the Scope Box’s [Bounding Box] into the “BoundingBox.Contains” node to get a list of Boolean values.

After collecting this data it was fairly straightforward: Get Indecise of [TRUE] from the aforementioned Boolean List, then employ the “[Synthesize_SP].List.ItemAtIndex+” node to retrieve only the appropriate elements from the initial list of elements.

Feed that list of ‘filtered’ elements into an assembly of OoTB nodes (Ending with the “Element.SetParameterByyName” Node) to set the '[Notes]" Parameter with a new [Value].

I went a bit further than necassary and utilized [Count] to get the numerical length of the Filtered elements, and fed that value into a dialog op-up message box, so to inform the user of the amount and type of elements that have been processed. I personally like the “UI.UserMessage” Node from the Rhythm package.

I’m interested to see what other users think of my methods, or if anyone else have used a different method to come to the same result.

Let me know, as well, if this is not the right place to post this little write up. I thought it may induce some interesting discussions. Thanks for reading!

2 Likes

Interesting post and process. Personally I haven’t had to tackle this exact situation, but I have had to do this for rooms, for which I used a custom node to pull what room was at a given point, pulling midpoints of curve based elements as needed. I suppose if you assigned a quadrant/sector to each room it would be pretty easy to map things to a coarse (sector), medium (room), and fine (location) scale.

1 Like

I would have included some more screenshots, however all of my development was induced by one of my current projects at work. I’m unable to post that content.

The most frustrating thing for me is the fact that you are unable to designate arbitrary “Zones” or “Areas” within revit, as this was my initial plan. However I circumvented this by using the Scope Box tool. And Luckily Dynamo is able to convert Scope Boxes to Bounding Boxes. I have never utilized Bounding Boxes before this, and I think I will keep it in mind for future use. It seems like a surprisingly useful tool.

1 Like

Yeah, no areas, but you can do Rooms (or Spaces) at point to shortcut the tie to zones.

1 Like

Hey,

Thanks for the interesting post :slight_smile:

Perhaps I’m misinterpreting… But don’t Revit ‘Areas’ do what you want? You can create an arbitrary shape (admittedly in 2D, but you could extrude to 3D using Dynamo) to create zones?

Bounding boxes are a great fast way of getting elements extents, but (just incase you didn’t know) they are axis aligned, so you may get some erroneous results. Also, obviously, if your zone is an L shape or 0 shape you’ll get some funny results…

Hope that’s useful,

Mark

2 Likes

Initially that was my plan, unfortunately the Revit “Areas/Zones” can only be defined via walls. In other words I would have to place four walls, and use those to designate the bounds of the “Area.” This was not a feasable method for me to use because the Project is for the Clients viewing and we don’t want to throw in random walls. Which is really unfortunate.

I and my company have a bit of a wishlist for things Revit should be able to do but cannot at this point in time. AutoDesk is pushing for it’s MEP Fabrication (AutoCAD) users to be switching to using Revit for complex Pipe designs, however Revit is simply not yet ready to be an MEP Fabrication Design program.

One thing I did notice about bounding Boxes is that they only operate in a cuboid fashion. For instance: a level 1 Zone is, say, 20ft by 20ft. And the South-Western-most corner is located at (0,0,0). And the sister-zone, on Level 2 is, say 20ft by 50ft., but the South-Western-most corners match up at the Project Origin (in referance to X&Y axis.) If I try to join/combine these two Bounding Box’s to create one complex shape, it will return a large cuboid Bounding Box that encompasses both initial zones and more.

With that being said, one would have to use two Bounding Boxes, which I ended up having to do.

I am currently working on a new script that will process each and every Scope Box within the Project, instead of having to select Zones/Areas individually for them to be processed, so I may have some more information to add to this post in the near future.

For areas, rooms, and spaces there is the option to not use the walls as binding and instead use Area Separation Lines, Room Separation Lines, and Space Separation Lines.

To Mark’s point (which your discovery on bounding boxes was an extension), you may want to completely understand how bounding boxes work before you go much further.

Draw a few adjacent rotated scope boxes and check the bounding boxes for overlap to understand the point more finely.

2 Likes

Thanks Jacob,

A link to info about Areas…

I wonder if part of the confusion is because you’ll want to work in an Area Plan not a Floor Plan.

Hope that helps,

Mark

1 Like

Ah I see. I think I was having trouble getting them set up correctly without Walls. I’ll have to try again soon to gain a better understanding.

1 Like