Announcements
Welcome to the Revit Ideas Board! Before posting, please read the helpful tips here. Thank you for your Ideas!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API access to Room openings geometry and materials in Revit

API access to Room openings geometry and materials in Revit

Currently, there is no easy way to access the geometry of a room with its openings. It would be very helpful to have one.

26 Comments
ebr
Community Visitor
Community Visitor
This. So much this.
abdelrahmann.sami
Community Visitor
Strongly, Support your idea Mostapha. I am with you, and very thanks for your effort in Ladybug and Honeybee for DynamBIM. (Y)
Renzoj14
Explorer
Anything to get you going with these great packages mostapha 👍🏼Great work
Anonymous
Not applicable

I also strongly support this.

arkinesis
Community Visitor
It would be great to have this. Total support.
brov0007
Community Visitor
Please, Mostapha!
KYDG
Community Visitor

The usefulness of this addition extends to other engineering disciplines like acoustics. Please add!

Anonymous
Not applicable
Having this would certinally streamline how we exchange information in our workflow.
devngc
Community Visitor
This is a must for Honeybee and Ladybug for Dynamo to be at par with the grasshopper versions of the same plugin. Strongly support this.
harlan_brumm
Autodesk
Status changed to: Under Review

Thanks for your submission and votes on this idea!  We are evaluating where this request falls into our roadmap and will provide an update when we have made a decision. 

The Factory

chriswmackey
Community Visitor

Very happy to see this!  I promise to make good use of this when it becomes available.

m.hamza_amu
Community Visitor

Definitely need this! Please Autodesk!

claudioarchi
Community Visitor

I must say I do not like autodesk tools but I need them. So please Autodesk. Mostapha is doing a great job on the other side of the spectrum (rhino and grasshopper)

WM_Ron_Allen
Collaborator

You can do this with Dynamo and the ROOM object in the API through a python script.:

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc =  DocumentManager.Instance.CurrentDBDocument

items = UnwrapElement(IN[0])
listElements = list()

for objRoom in items:
	sublist = ""
	try:
		objDoc = objRoom.Document
		calculator = SpatialElementGeometryCalculator(objDoc)
		objResults = calculator.CalculateSpatialElementGeometry(objRoom)
		
		objRoomSolid = objResults.GetGeometry()
		
		
		#sublist.append(objRoom.get_Parameter('Number').AsString())
		#sublist.append(objRoom.get_Parameter('Name').AsString())
		
		for objFace in objRoomSolid.Faces:
			faceArea = objFace.Area
			subfaceList = objResults.GetBoundaryFaceInfo(objFace)
			try:
				origin = objFace.Origin
				Ht=0
				Ht=origin[2]-objRoom.Level.Elevation
				normal = objFace.Normal
				#vector = objFace.Vector[0]
				if normal[2] < 0 and Ht > 0 :	#assuming normal[z] is negative for room bound ceiling)
				#if  Ht > 0 :
					for objsubface in objResults.GetBoundaryFaceInfo(objRoomSolidFace):
						try:
							objBoundingElementface = objsubface.GetBoundingElementFace()
							objEid = objBoundingElementface.MaterialElementId
							if sublist.Length > 0  : sublist = sublist + "; "
							sublist=sublist+'Mat.Name='+ doc.GetElement(objEid).Name + ', Mat.Area={:,.3f}'.format( faceArea)
							#Sublist.append('Material Name = '+ doc.GetElement(objEid).Name +', Material Id = '+ objEid.IntegerValue.ToString()+', Material Area = '+ faceArea.ToString()+ ', Ht=' + str((origin[2]-objRoom.Level.Elevation)) +'\n')
						except:
							continue
					if sublist.Length > 0  : sublist = sublist + "; "									
					sublist=sublist+'ClgHt={:,.3f}'.format(Ht) #Height of element's origin above the floor
					
			except:
				continue
	except:
		if sublist.Length > 0  : sublist = sublist + "; "	
		sublist=sublist+"err#"
		
	listElements.append(sublist)
OUT =(listElements)

Ron, Thank you for your post. I can't see how you get the geometry of the window or the wall with windows removed in this code. Also this may clarify what are we trying to get out of Revit: https://github.com/ladybug-tools/honeybee-plus/blob/master/honeybee_dynamo/revit.py#L191-L324

 

WM_Ron_Allen
Collaborator
If I remember the class correctly in the API it bounces the materials back. You may need to look at materials rather than "Windows" to discern areas.
WM_Ron_Allen
Collaborator
If I remember the class correctly in the API it bounces the materials back. You may need to look at materials rather than "Windows" to discern areas.
mdengusiak
Advocate

Can we apply the same rule to Spaces:

API access to Space openings geometry and materials in Revit

ludvig.haav.6151
Community Visitor

What are the limitations in the current setup?

 

Im about to make daylight factor analysis in a large project, and it would be nice to know beforehand which type of gemetries/models might cause problems. I need to know If I should put hours into working in experimental Dynamo or put those hours in exporting to my safezone grasshopper. I wont have time for both...!

jamiewalkrr
Community Visitor

Definitely agree, more grasp of room geometry (incl. ceiling and openings) would vastly help anyone attempting simulation/analysis.

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Autodesk Design & Make Report


Autodesk Design & Make Report