Check the first image in the link I shared above - the package has a “Load Into Project” node, it appears this workflow should work from the project environment and background opens/modifies/closes the family documents, then reloads it into the current document
With the workflow I shared above, you wouldn’t be pulling the family documents from inside the current document, rather, plugging in the file contents of the directory where all the families are located into the Document.BackgroundOpen node
Try inputting a code block that says null with no quotes (not a string) and see if that works
(the link @Steven shared is pretty much identical to what I linked above, there is a .dyn file attached)
I just had a look at the Python code within the DanEDU.FamilyDocument.SetFormulaByName node, and it converts the values into strings so inputting a null value doesn’t seem to work. If you paste this into a Python script node, it will accept a null value (removed the quotes around values[idx] in line 39)
#Copyright(c) 2014-2017, DanEDU Dynamo
#Erik Falck Jørgensen, Technical University of Denmark (DTU)
from Autodesk.Revit.DB import*
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
#log builder, only for testing
#log = 
#input assigned the IN variable
docs = IN
params = IN
values = IN
#wrap input inside a list (if not a list)
if not isinstance(docs, list): docs = [docs]
if not isinstance(params, list): params = [params]
if not isinstance(values, list): values = [values]
#default document set to DocumentManager.Instance.CurrentDBDocument
if docs == 'Current.Document':
docs = [DocumentManager.Instance.CurrentDBDocument]
#core data processing
for doc in docs:
for idx, item in enumerate(params):
param = doc.FamilyManager.get_Parameter(item)
log = 'Formula set successfully'
#only for testing
#log.append('Formula set successfully')
log = 'An error occurred! Please veryfy setting'
#only for testing
#log.append('An error occurred! Please veryfy setting')
#output assigned the OUT variable
OUT = docs, log
I dont know why I did change it to a string, I can see that the node “FamilyDocument.SetParameterByName” is taking the input in the “correct” way, so I must have forgotten to update the code in the “FamilyDocument.SetFormulaByName” node.
This doesn’t allow you to edit the family from the project environment. This is more of a workflow concern, since i could save the families out to a folder and reload them once the formula is updated.
you cant edit formulas in project mode, that is not doable in revit at all. The only way is to open the family and edit the formula.
thats why I made the nodes for families and as @awilliams (and @MJB-online) describes, you must use a method to open and close the families. I use @john_pierson Rythm nodes since they do the job excellent (Beaker nodes is also @john_pierson).
@Revit_Noob So i am not sure how to fix your code… i 've tried all i know with no results…
but if all you want is to add text value to a parameter, they you can use the code attached… the only catch here is that you have to load your family into some project, then run dynamo from within that project. so you cannot run it on the family itself.
if this works for you and you have a bunch of parameters to change, i can send you the code to load them from excel. Revit_Noob.dyn (25.1 KB) Revit_Noob.pdf (107.6 KB)
Yes, you can.
In step 2, in the pdf that sent, you can put the prefix there instead of “family…add to”.
You will find this in the “string contains” node.
Just put any value that is unique to the families that you want to modify.