Get Room Boundaries

I am using Room Boundaries node by archilab to get the room bounding elements such as Wall, columns.
But this node is giving some duplicated elements (walls).

I can eliminate duplicates but I don’t want to eliminate them when there is a rectangular column with multiple sides inside the room boundary.

Please suggest how to remove those wall duplicates.

My guess is that it’s picking up the same wall twice as it is bounding two rooms…

I’m a bit confused as to what you’re asking but maybe try “List.UniqueItems” if you want to get rid of duplicates. :slight_smile:

One of the wall is an exterior one (not shared with any other room) which is duplicated.

I can’t use List.Unique items, because there are rooms with rectangular columns in it. Those columns have different sides bounding the room and I want them to be counted maybe twice, thrice depending upon its position.

Just to confirm, are the curves associated with the duplicate items also duplicate?

Will check that. Off from work.

I just tried it on the Autodesk sample project.

I think you need to give us a bit more graphical information…

Reading your text has me very confused. :confused:

1 Like

Apologies. I’ll share the details when I get back to work.

Pfff… log in over the weekend… The internet never sleeps :smiley:

@Alien
Here, all that I don’t want are the repeating walls.

The column is repeated 4 times because 4 sides of it are bounding the room.

@Robert_Younger, Curves are not showing anything.

If anyone would like to have a look at the python code.

# Copyright(c) 2015, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net

# This node was an update to Wall.Boundaries node
# that can be found in Clockwork package. Thanks
# to Andreas Dieckmann for making the original one.

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)

def Unwrap(item):
	return UnwrapElement(item)

def ProcessList(_func, _list):
    return map( lambda x: ProcessList(_func, x) if type(x)==list else _func(x), _list )

def GetRoomBoundary(doc, item, options):
	eList = []
	cList = []
	try:
		for i in item.GetBoundarySegments(options):
			for j in i:
				eList.append(doc.GetElement(j.ElementId))
				cList.append(j.Curve.ToProtoType())
	except:
		calculator = SpatialElementGeometryCalculator(doc)
		try:
			results = calculator.CalculateSpatialElementGeometry(item)
			for face in results.GetGeometry().Faces:
				for bface in results.GetBoundaryFaceInfo(face):
					eList.append(doc.GetElement(bface.SpatialBoundaryElement.HostElementId))
		except:
			pass
	return [eList, cList]

if isinstance(IN[0], list):
	items = ProcessList(Unwrap, IN[0])
else:
	items = [Unwrap(IN[0])]

options = SpatialElementBoundaryOptions()

boundloc = AreaVolumeSettings.GetAreaVolumeSettings(doc).GetSpatialElementBoundaryLocation(SpatialElementType.Room)
options.SpatialElementBoundaryLocation = boundloc

elementList = []
curveList = []

try:
	errorReport = None
	if isinstance(items, list):
		for item in items:
			elementList.append(GetRoomBoundary(doc, item, options)[0])
			curveList.append(GetRoomBoundary(doc, item, options)[1])
	else:
		elementList = GetRoomBoundary(doc, items, options)[0]
		curveList = GetRoomBoundary(doc, items, options)[1]
except:
	# if error accurs anywhere in the process catch it
	import traceback
	errorReport = traceback.format_exc()

#Assign your output to the OUT variable
if errorReport == None:
	OUT = [elementList, curveList]
else:
	OUT = errorReport

@theshysnail, what’s the final purpose of getting columns this way? Do you need bounding curves of columns?

Walls and all others are repeating, just use Room.FinishBoudary and you’ll see, N elements and N curves in room.

P.S. Do you have latest version of Archilab? _curve list must contains corresponding curves of elements. Or you can use Room.Boundaries from ClockWork package.

Look here too: To get Floors from Room Boundaries, Archilab and Clockwork

I am trying to get the net area of a room (all paint-able faces excluding walls/windows).

Look at Room.Finishes from Clockwork