Hi All,
This question seems to be asked earlier. But in my case the Equipment is above the room boundary (Ceiling space).
So I couldn’t use any of the Nodes like Element.in room. So I copied a script & added codes to bring the Element location point - Z to 0. & when I run the script, I am only getting 1 Equipment parameter set…
Don’t know why…Plz help…
Scripe code
import clr
import sys
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
roomlist = UnwrapElement (IN[0])
#pointlist = IN[1]
elementlist = UnwrapElement (IN[1])
outroom = []
outfamily = []
for family, room in zip(elementlist, roomlist):
pt = family.Location.Point
ptx = pt.X
pty = pt.Y
ptz = 0
pt1 = XYZ(ptx,pty,ptz)
if room.IsPointInRoom(pt1):
outroom.append(room)
outfamily.append(family)
OUT = outfamily, outroom
Room name to Equipment_Script.dyn (10.1 KB)
Sample file below…
https://1drv.ms/f/s!Au4nQORJGDGchEo6-vvb3ZN3IyiR