- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone:
I've been trying to use Dynamo to automate the "Mark" field in my curtain panels according to the "Mark" field of their curtain wall host.
In my project I use a wall family as a curtain panel as it's needed to add walls and windows to said walls. Since the positioning of these walls and windows does not match exaclty with the curtain grids, adding a panel as a window and door is not an option. Therefore I don't use a panel family as "Curtain Panel" for my wall.
This Mark field is used for schedules as I work with prefab panels and I add the name of the host wall to the panel.
My problem is that I don't know how to get Dynamo to identify the walls being used as a Panel in my curtain walls. I have been trying for Dynamo to identify regular walls from walls being used as Panels by using the Parameter "Categorize as" as a difference between the two. I know that the "Categorize as" is an integer with values 0=Panel and 1=Panel. What I want is for the Mark field in my curtain panels automatically updates everytime a change this parameter in the host wall.
This is my Dynamo graph:
And this is my Script:
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
# Begin transaction
TransactionManager.Instance.EnsureInTransaction(doc)
panels = UnwrapElement(IN[0])
updated_count = 0
for panel in panels:
# Assuming the "Type Mark" of the host curtain wall needs to be synchronized
type_mark = panel.LookupParameter("Type Mark").AsString()
if type_mark:
# Loop through related curtain panels to set "Type Mark"
# This example assumes direct access to related panels; adjust logic as needed
panel.SetParameterByName("Type Mark", type_mark)
updated_count += 1
TransactionManager.Instance.TransactionTaskDone()
OUT = updated_count
Any suggestions would be greatly appreciated as 😊
Thank you so much!
Solved! Go to Solution.