I am trying to make a Dynamo script that takes all the parameters in all families that contain a certain material and changes it to " " globally, in project or family editor. I have so many families with types that i need to edit so i am trying to make my life easier and not do it manually.
I got stuck and i don’t know how to continue… i tried to find information online but i can’t find anything about it.
I managed to make it so that it detects the material (i’m doing this in family editor) but when i tried to continue from here i only got errors so i errased the rest of the attempt…
import clr
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
OUT = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Doors).WhereElementIsElementType().ToElements()
Before we start, it’s probably noting that if these were shared parameters, they could be set in a schedule most quickly and easily.
If you need to go Dynamo, I’d investigate it by element parameter value primarily… I’d have a few ‘set parameter’ for the ones you’re after.
It looks like you are dealing with Type parameters? So you want ALL Types, not just the Types of those elements which are placed? That requires a bit of python (or a custom node).
You’ll see that empty material parameters are being returned as an empty String, I know this because I used the Type node to identify the data type.
You’ll note the use of the FilterByBooleanMask to keep both streams of data consistant.
You’ll notice that the parameter value we are setting is a Material element.