Schedule with Room Area and Ceiling Area

Hello everyone, I’m new here and I started with Dynamo a few days ago, I try to create a script able to set the ceiling area into a personal room parameter and give the possibility to schedule the two areas.

The process will be:

  • Read the Room Area;
  • Read the Ceiling Area;
  • Create a parameter into Room Category (example CL Area)
  • Write the corresponding Ceiling Area into the CL Area corresponding to the room
  • Now I could schedule it into Revit

The main problem with this process is the sequence to create ceiling and room because if it is not the same sequence the script report some cross reports.

How can I resolve this?
and in the future, if I will have two ceilings in a single room (or two rooms below a single ceiling) who can I add the multiple areas into only one parameter?

Right now you are pulling both list in the order that each elements have been created.
You need to find a way to "match those and using location would be one way to do it.
Get all room location point
Get all ceilings geometry
Check which point is inside the ceilings and you then have a match

1 Like

2021-05-12_13h30_00

Yeps try to sort your list…like this or as Draxl mention…

1 Like

Depending on the project, Sort is not necessarily the best solution, several rooms may have the same area, and there may be several ceilings in the same room, the method given by @Daniel_Hurtubise is preferable in this case.

Here is another method with Revit API

import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

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

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
		
rooms = UnwrapElement(IN[0])

calculator = SpatialElementGeometryCalculator(doc)
outData = list()
for room in rooms:
	if calculator.CanCalculateGeometry(room):
		results = calculator.CalculateSpatialElementGeometry(room)
		roomSolid = results.GetGeometry()
		temp = list()
		for face in roomSolid.Faces:
			for subfaceInfo in results.GetBoundaryFaceInfo(face):
				if subfaceInfo.SubfaceType == SubfaceType.Top:     
					lnkelemId = subfaceInfo.SpatialBoundaryElement 
					elem = doc.GetElement(lnkelemId.HostElementId )
					if isinstance(elem, Ceiling ):
						temp.append(elem)
		if temp:
			outData.append([room, temp])
OUT =  outData
2 Likes

@c.poupin so true indeed :wink:

Thanks all guys for the quick reply.

@c.poupin I think your reply is the best but it’s too over my actual level, I don’t know API.
Draxl_Andreas very interesting node, I try it, but if I’ve two room or ceiling with the same area that reports a mistake

@Daniel_Hurtubise I’ve been trying to find “Get all room location point” or “Get all ceilings geometry” but I didn’t found this node. Is necessary some external package?

i’ve found here Room Location Point
i could try to find the " *solid.centroid" of the Room

Hi @mandrea85

Here is another way not sure you can use it…

I’ve try with python node but 'ive an empty list