[Help] Electrical fixture schedule with room name linked arch-rvt file

Hi, I have electrical revit model and want to get room name, which linked in the arch-rvt model, architectural file not used for the space,if they used in space then we can get, but they used room, tried to search in the forum also, but not succeed,
Could any help on this regard, would appreciated, I’m attaching the both model of this revit files, if anyone can guide me with dynamo script for to get this room name in the schedule.

sc

Revit file- Architectural & Electrical model, 3+3MB, Version-2019

Probably a better way…:wink:

1 Like

Hello
for information, the ‘FacingOrientation’ property return a vector parallel to the host surface (not the normal) :wink:

3 Likes

Thanks @c.poupin …so true…think its depends on how the family is build, in my family its give the right vector…

1 Like

An alternative solution with Python (Assuming all elements are of type 'face-based families)

import clr
import sys
import System
from System.Collections.Generic import List
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS

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

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

toList = lambda x : x if hasattr(x, '__iter__') else [x]

lstCats = toList(UnwrapElement(IN[0]))
out = []

cat_list = [System.Enum.ToObject(BuiltInCategory, c.Id.IntegerValue) for c in lstCats]
typed_list = List[BuiltInCategory](cat_list)
filtercat = ElementMulticategoryFilter(typed_list)
# get the host Link Document
oneElemInCurrentDoc = FilteredElementCollector(doc).WherePasses(filtercat).WhereElementIsNotElementType().FirstElement()
host = oneElemInCurrentDoc.Host
linkdoc = host.GetLinkDocument()
# get all rooms in Link Document
allRoomslnk = FilteredElementCollector(linkdoc).OfCategory(BuiltInCategory.OST_Rooms).WhereElementIsNotElementType()
# check rooms
calculator = SpatialElementGeometryCalculator(linkdoc)
for room in allRoomslnk:
	if calculator.CanCalculateGeometry(room):
	    results = calculator.CalculateSpatialElementGeometry(room)
	    roomSolid = results.GetGeometry()
	    filterSolid = ElementIntersectsSolidFilter(roomSolid)
	    andFilter = LogicalAndFilter(filterSolid, filtercat)
	    elemsInRooms = FilteredElementCollector(doc).WherePasses(andFilter).WhereElementIsNotElementType()
	    for i in elemsInRooms:
	    	out.append([Element.Name.__get__(room), i])
	    results.Dispose()
	    
calculator.Dispose()
OUT = out

Note:
However, pay attention to the heights of rooms in the linked model
some elements could be found outside rooms volume

4 Likes

Thank you Sovitek, for your kind response in detail, as i am the beginner in the dynamo, not having programming background, could you please help me further, as i did on the same on your script, with no error after running, but i checked in schedule its not showing any room name, I am using revit version-2019 and dynamo 2.0.3.8811,

Thank you


dyn file

@c.poupin Thank you for pointing out, I just made sample file without sharing the original file the project privacy, didn’t notice orientation of the object,
Thank you

Hello…@Shan …Thats great…see if this here will work for you ?

@sovitek Can you check this error, little confused the looping, could please share the dyn file if you don’t mind,

No worries…here we go
fixture.dyn (42.4 KB)

What kind off parameter is Room Name ??..if you want you can share your RVT file and i will try to fix it :wink:

I had already uploaded revit in the first link of my post, pls check

revit file link

1 Like

I had run your dyn fill, but its showing this warning,

Great !,
How its got ?

Remove your “Room name” Parameter in the schedule view, go to parameter make a new room name parameter as text

I can in your image your pick floors as categori, wasnt it eletrical fixtures ?

by mistake, Its electrical fixture, I had removed the parameter and added new parameter as text, but not getting, can you share the dyn again,
Thanks a lot for the time for helping me to this issue sort out,
Appreciated :vulcan_salute:
Capture-4

see the error