Can we fill room tag data (like Name & Number) into Mechanical Equipment using Dynamo

can we fill room tag data (like Name & Number) into Mechanical Equipment using Dynamo

Yes

how can you explain pls

Hi @Vikram.Bhaliya best show us what you have tried so far, and we can try help from there..

and yes should be possible, how i would try, create some parameters for your tag, and intersect your elements with rooms, and write to these parameters

What have you tried so far? Can you share a Dynamo graph?

i am trying to adding room tag info into diffuser and mech equipment so i can sort quantity as per room

1 Like

yes i know, but show us how far you are with that if not it will probably be just a finish solution we give, and nobody havent been clever…imo :wink:

1 Like

Some breadcrumbs:

  1. ElementLocation
  2. Element.Solids
  3. Solid.ByUnion
  4. GeometryColosestPointTo
  5. Get room at point
  6. GetParameterValueByName
  7. SetParameterValueByName
2 Likes

its just scratch idea i know i should come with some node .let me work on it. Thanks

yeah its a great idea :wink: try something as @jacob.small mention, and if you go stuck, just share it here and we will be happy to help if we can :wink:

its working can we use space instead of room ?

Have you tried finding a “Select.SpaceAtPoint” instead of the room version? MEPover has such a node which you can try (not sure it works in newer builds or not).

1 Like

should work in newer builds, cpython, pythonnet 3 just set engine in that case…so great :wink: or ootb..FamilyInstance.Space…Space.IsPointInsideSpace

I don’t like that particular method as it requires testing every point against EVERY space. Better to go the custom route if need be - the Python can be written up in about 20 minutes, and made ready to scale in an hour or so.

yeah sure ;9 i always use that , as it support phases…sometimes great depends…

import clr

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

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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

if isinstance(IN[0], list):
	point = [x.ToXyz() for x in IN[0]]
	toggle = 0
else:
	point = [IN[0].ToXyz()]
	toggle = 1
phase = UnwrapElement(IN[1])

listout = []
for p in point:
	space = doc.GetSpaceAtPoint(p,phase)
	listout.append(space)

if toggle:
	OUT = space
else:
	OUT = listout

My preferred implementation would be something like this to incorporate the input validation and a few other bits, as well as catching the phase if none given.

########################################
############## Properties ##############
########################################
__author__ = 'Jacob Small'
__version__ = '0.1.0'
__description__ = "Get the space at each point given, using the provided phase for the latest phase in the document."
__RevitBuilds__ = "2026.3"
__DynamoBuilds__ = "3.6"
__ReleaseNotes__ = "POC only - not tested for production use."
__Dependancies__ = "None"
__Copyright__ = "2025, Autodesk Inc."
__License__ = "Apache 2"



########################################
### Configure the Python environment ###
########################################
### standard imports ###
import sys #add the sys class to the Python environment so we can work with the sys objects
import clr #add the CLR (common language runtime) class to the Python environment so we can work with .net libraries

### basic Dynamo imports ###
clr.AddReference('ProtoGeometry') #add the Dynamo geometry library to the CLR
from Autodesk.DesignScript import Geometry as DG #add the Dynamo geometry class using the alias DG, to ensure no overlap between class calls in Revit or Dynamo

### Dynamo Revit imports ###
clr.AddReference("RevitNodes") #add Dynamo's Revit nodes library to the clr
import Revit #import Dynamo's Revit node class
clr.ImportExtensions(Revit.Elements) #add the element conversion methods to the CLR
clr.ImportExtensions(Revit.GeometryConversion) #add the geometry conversion methods to the CLR
clr.AddReference("RevitServices") #add the Revit services library to the CLR
import RevitServices #import the Revit services class to the Python environment
from RevitServices.Persistence import DocumentManager #import the document manager class to the Python environment 

### Revit API imports ###
clr.AddReference("RevitAPI") #add the Revit API to the CLR
import Autodesk #add the Autodesk class to the Python environment 
from Autodesk.Revit.DB import * #import every class of the Revit API to the Python environment



#########################################
###### Global variables and inputs ######
#########################################
### documents and standard variables ###
doc = DocumentManager.Instance.CurrentDBDocument #the current Revit document

### imports and unwrapping ###
points = IN[0] #import the Dynamo points from IN[0] of the Dynamo environment 
if not isinstance(points, list): points = [points] #ensure points is a list
[sys.exit("\r\rOne of the provided objects in the 'points' input was not a point. Revise input and try again.\r\r") for i in points if not isinstance(i, DG.Point)] #throw an error if anything other than a point was provided as an input.
phase = UnwrapElement(IN[1])  #get the phase from IN[1] of the Dynamo environment 
if phase == None: phase = [i for i in doc.Phases][-1] #get the last phase if none was provided
if not isinstance(phase, Phase): sys.exit("\r\rProvided phase is not valid. Revise the input and try again.\r\r") #throw an error if something other than a space was provided


spaces = [doc.GetSpaceAtPoint(i.ToRevitType(),phase) for i in points] #get the space at each point provided

#########################################
##### Return the results to Dynamo ######
#########################################
OUT = [i.ToDSType(True) for i in spaces] #return the spaces to the Dynamo Environment

nice

1 Like

Thanks Jacob. i am not familiar with python yet this script is become node ?

Paste it into the Python node after you double click to edit it.

I recommend you go over the Dynamo primer. Skip no exercise even if the outcome doesn’t seem pertinent to your work - the outcomes aren’t what matters but the process and concepts therein.