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.
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