Tool.GetSurroundingElements finds light fixtures outside room geometry

I am using the SteamNodes Tool.GetSurroundingElements to locate receptacles and light fixtures by room from a linked model. Locating the receptacles works great and I am able to export the room list with the sum total of the receptacle loads. However, when applying the same, but slightly modified, script to locating the light fixtures the Tool seems to overlap the fixtures applying a found fixture to more than one adjacent room. I have set the Tolerance to various settings and even at 0 the effect is the same. Strangely the Tool seems to pull the geometry from the level below(?). The fixtures are on the second of three levels. As can be seen in the attached snip, the filter found the two fixtures and the Tool assigned the same fixture to two separate rooms. Fixture 4169617. The fixtures are hosted by the linked model at 10’-0". As I said earlier, the same logic run against receptacles at 1’-6" works fine.
Any thoughts?

Hi @jbrowning
You can also use @john_pierson Rhythm package node “Element.Room” to find elements (lighting fixtures) in room.


Hi @jbrowning sometimes extra room separators along all walls of a room might work or renaming a little bit different (name with numbering), the adjacent fixtures might not show up…though am not sure :slight_smile:

If you’re pulling stuff from below often it’s because a part of the family poking up through the floor of the room. This could be an invisible line or other element used to control graphics in plan/section/elevation, or maybe even the light symbol.

I’ve also seen issues where rooms were not placed on the level in question (multiple levels on a floor plate, people place the rooms in one view, and the base of the room automatically constrains to the active view) so your rooms could be overlapping in section. Easy way to check is to cut a section through both rooms and turn on color fill. If they overlap it’ll be clear.

You can also try rebuilding the geometry of the room and the light, then intersecting the two and placing the resulting geometry into the model. You may find what you are after that way.

Thank you all. I will explore the suggestions.

@jbrowning Don’t forget to mark the post as solved. If it solved for you. Cheers!

I tried Element.Room and as you can see from the attachment the node returns null. I wasn’t sure how the node would know the rooms from the linked model. With Tool.GetSurroundingElements I pass the rooms to the node and it at least finds the fixtures. Of course, it finds the same fixture in multiple rooms.
The script uses the CustomRoom.FromElement (DynamoMEP package) to create custom rooms from the rooms passed to it from the linked architectural model. These rooms are then passed to the Tool.GetSurroundingElements. I will continue to experiment and verify the room geometry is consistent. Interestingly enough, the script reports the fixture height at 25-ft when the actual height is 10-ft hosted to the ceiling in the linked model.

@jbrowning Could you please drop here your files? Thanks :slight_smile:


Unfortunately the owner of the files is a regional bank and will not allow us to share their building layouts for security reasons. I will extract a sample of the model and post it. I think they will allow that.

Did you tried @Konrad_K_Sobon 's archi-lab package node “ElementsInRoom”?

As you can see, it returns an empty list.

I discovered that the FamilyInstance.Location node will return as the z coordinate for light fixtures the elevation of the fixture PLUS the level elevation. So in my instance 2nd floor light fixtures are set at 25.333 ft which is the 2nd floor elevation at 15’-4" PLUS the elevation of the fixture at 10’-0". The fixture is hosted in the ceiling of the linked model. When I deconstruct the points and subtract 10 from the z coordinate then reconstruct the points the fixture is within the bounding box. Some more work to do to determine the correct number to subtract from the z coordinate based on the level the fixture is located but progress is being made.

I am to the point where I have the fixtures discovered properly for the level and room they are in. I abandoned the Tool.GetSurroundingElements as I just could not get it to work. The combination of Revit/Dynamo indicating the fixture Z coord at the level + the mounting height was just not working with the Tool. So, I used BoundingBox from the geometry of the rooms and manipulated the z coord to place the fixtures within the bounding box and was able to successfully get the correct fixture in the correct room. I am now at the point were I have created a list similar to the attached. The attached is a concept to indicate my question. How to I combine the sublists so I get {0,a,b,c},{1,d},{2,e},{3,f}? from the list created by the node List.GroupByKey?

Hi @Kulkul
I tried to add the circuit number with room name and also tried to add the no.of light fixture type with no.of light fixture count connected in the room. But there is some message are displayed. Can u please advice me.

@dpradeep5110 Currently your feeding string value to “ElementsinSpace” node. You need to feed actual space elements.

Thanks for your information@Kulkul

Hi @Kulkul There is any possible to take the information from electrical circuit using dynamo. If Possible means I need to create a room name based on electrical circuit. Can u give a solution for this.

Select the electrical circuit and use a Element.Parameters node as a start.

@jacob.small thanks for your information.

There is any way to add the space name in electric circuit. I am struggling at this point. Any one can give solution for this.