Read From-Room Door Parameters

Hello Community,

due to a project, I need to place door description texts on my plans. These description texts need to follow a certain key that is given by the client. One part of the description key is the room number.

Unfortunately, Revit doesn`t allow to use the “from-room” / “to-room” information as a parameter for description texts.

So I had the idea to copy the given information (from-room/to-room) to an extra shared parameter and map this with dynamo.

Now I failed to receive this information as a string from dynamo. Get Parameter Value by name doesn’t work to achieve a solution.

Thanks in advance.

Mark

1 Like

@mark.surges ,

Hello, how you doing?

go via Python to get the information…

import clr

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

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

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

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

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
doors = UnwrapElement(IN[0])
torooms = []
frrooms = []

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

for i in doors:
    torooms.append(i.ToRoom)
for x in doors:
    frrooms.append(x.FromRoom)
    
TransactionManager.Instance.TransactionTaskDone()

OUT = torooms, frrooms

KR
Andreas

2 Likes

Hi Andreas,

of course! Thank you so much. It worked as you said! Thanks a lot!

1 Like

hi am getting this error.

1 Like

I recommend using the node in Clockwork package for this task.

2 Likes

@Revit_Noob ,

It has to be modived in older versions…
or i think i did the screenshoot to ealry ;)… just experiment a little bit.

KR

Andreas

1 Like

@jacob.small , @mark.surges

yes thats fine!


KR
Andreas

1 Like

For some reason this node wasn’t part of my clockwork package anymore. I went Andreas way.

Seems like I am using not the latest clockwork version. I’ve got to check this out.

Thx

1 Like