I want the graph to associate multiple furniture-category family types (which share the same single YesNo - type parameter) to a global YesNo parameter.
From this post (Associating Global Parameters to a family in a project), I want to associate a global parameter to multiple family types simultaneously.
associate global params to elements.dyn (11.2 KB)
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 element = UnwrapElement(IN) name = IN gp = IN #Get parameters from element parameters = element.Parameters myparam =  TransactionManager.Instance.EnsureInTransaction(doc) #Get parameters with the input name for param in parameters: if param.Definition.Name == name: myparam.append(param) #Associate parameter for x in myparam: try: x.AssociateWithGlobalParameter(ElementId(gp.Id)) out = "Success" except: out = "Fail" TransactionManager.Instance.TransactionTaskDone() OUT = out
-I specialize in furniture and security plans for my company. We use generic annotations to label the furniture and we also use generic annotations for our security symbols. In our furniture plans, we would only like the furniture labels to show, and since labels and text can’t be assigned subcategories, they are stuck at the “Generic Annotation” category. Our security plans show our furniture labels and it looks very messy.
I am searching for a way, using dynamo and python, to associate the furniture labels.
-The furniture labels are toggled via a YesNo FamilyType Parameter
-I would like my users to use the dynamo player to automatically associate the family type parameter to a global parameter in their projects.
-We have multiple furniture families and types, so it would need to receive a list of (unique) family types which it will then associate to a global parameter, so that non-dynamo savvy users can automate this process.
-I have tried using the Orchid Package “Parameter.Associate” and a custom python script and it seems to only take one family type at a time. (thanks to this post)
–I wonder if I just need add a loop for the IN to make it work.
If it’s not too difficult / unreasonable, I am calling for erfajo