Elements in room node Issue

Hi all,

while trying to script a way to get all elements contained in the room, I got to the error in node Elements in Room.

When a category such as Mechanical Equipment is selected everything works fine as shown in the picture:

However, when a category such as Pipes or Ducts is selected, the node gives the following error:

Is this expected behavior?..not sure do I miss something…

Hi @Marcelo.Rak,

You could try with the Element ToRoom node of the Genius Loci package.

In Revit Ducts or Pipes it takes two points to create one. So more than one Room would be in the List?
With Mechanical Equipment it takes just one point.
Also, is the Room height sufficient? Pipes and Ducts are mostly above Ceiling i think.

1 Like

It looks like the package you are using is looking for the family.Location.Point property of elements. (If that is the Archi-Lab node). A lot of elements won’t have that property. This will include system families and line based families.

So what you are after may take some thing much more robust than something looking for a simple point. For something like pipes you would have to look at the line from the start point to the end point or the actual geometry of the object itself and see if that intersects the room geometry. And yes - as noted - if the ceiling constrains the upper limit of the room with a pipe above the room, that will be an additional problem to work around. You would have to do something like ray casting to the floor or level below for all objects and see if they intersect the room at that level.

Yes - this is expected with ths node. It is functioning as designed.

Yes always difficult to say which space pipe or duct or walls, curtain walls belong to…with pipes and duct you can use parameteratpoint on the location line and intersect them…

And just glancing at the ToRoom from Genius Loci, it looks like that is picking up both location points, location curves and bounding boxes. The curves seem to be reduced to the midpoint of the curve for determining the location.
pt=loc.Curve.Evaluate(0.5, True)
Same for the bounding box location - it looks like the center of the bounding box is being used as a location point.
uv=(bbox.Min+bbox.Max)/2

I have two scripts using the Archi-labs nodes. one that gets a parameter name for the Room Location and another that gets a parameter for the Space Location using conduit. With the Space node, conduits work. with the Room Node, conduits do not work. My question is was the Space node updated with the:

if type(location) == LocationPoint:
pt = location.Point
else:
pt = location.Curve.Evaluate(0.5, True)

I did a comparison of the two nodes and These are the differences:

Room Node:

n.Point

	if _room.IsPointInRoom(pt):
		outList.append(family)
	else:
		for phase in _doc.Phases:
			inRoom = TryGetRoom(family, phase)
			if inRoom != None and inRoom.Id == _room.Id:
				outList.append(family)
				break
return outList

Space Node:

def FamiliesInSpace(_space, _families, _doc):
outList =
for family in _families:
location = family.Location
if type(location) == LocationPoint:
pt = location.Point
else:
pt = location.Curve.Evaluate(0.5, True)
if _space.IsPointInSpace(pt):
outList.append(family)
else:
for phase in _doc.Phases:
inSpace = TryGetSpace(family, phase)
if inSpace != None and inSpace.ToDSType(True).Name == _space.ToDSType(True).Name:
outList.append(family)

return outList

[Edit:] Yeap, that exactly what is was. I edited the in Room node and it now works with conduit.