For the past few weeks, I’ve been working on a Dynamo script that adds Shared Parameters from an Excel file to one or more Revit Families, and assigns values to some of those parameters.
I’m doing this as part of my internship at a construction engineering firm. Since my colleagues aren’t familiar with Dynamo, I’m focusing on creating scripts that work with Dynamo Player and are easy to use.
Currently, I have a script that successfully adds Shared Parameters from an Excel file to the active Family Document. I’ve accomplished this using the Crumple package. After that, I was able to add formulas to those parameters. However, I’m running into an issue with the Crumple node FamilyDoc.SetParameterValues. It doesn’t seem to set the parameter values and always returns a null output.
I’ve attached some images of my script and the input Excel file below. As you can see, everything works fine up until the FamilyDoc.SetParameterValues node.
Use a Transaction End Node after the create parameter Node before you set the value.
The first action needs to complete before you can set the parameter (second action)
My nodes dont work well with levels, they auto lace based on the family doc input (single or list are the only accepted inputs).
I made this choice as i found it very difficult to get levels to work with these types of nodes in Orchid and my own nodes before. It’s not intuitive to bulk process unless the nodes take clear input structures, especially in Python. These days I tend to use Python/C# for this type of process as Dynamo is too flexible in regards to bulk processing structures (usually a good thing, but not in the case of one/many/many on many type tasks).
No need for transaction nodes, my nodes handle this.
Check the inputs for expected list structures. Generally my nodes try to go from one to another without the need for list restructuring. An example in the case of adding parameters is the node checks for the number of family documents, then the number of parameter lists. If the parameter list is flat, it repeats it that many times per family document to achieve a ‘Longest’ behavior. In the case of setting parameters by name, it goes one level deeper in checking number of types per family document specified, so value/paramater lists are expected or forced into lists of lists. Necessarily complex…
Going straight from parameter creation to setting is hard as you add the extra dimension of types. You will likely need to replicate the value lists per type(s) per family document between the two nodes. I have a node for getting all types of a familydoc you can use to check the needed list cycles.
You can find a get/set values to/from excel example on my github for reference:
I have tried to get the FamilyDoc.SetParameterValues node to work by using Code Block nodes. I used a single parameter that is added in the Family, a value for that parameter, the type in the Family Document, and the Family Document itself as inputs. However, this still doesn’t work for me. Does the SetParameterValues node only work with the node ReportToValues node? See the image below:
I have also downloaded your Crumple_SetParameterValues.dyn script. In it, the FamilyDoc.ReportToValues node is used. I looked into the Python code of that node to figure out what inputs it needs to provide the correct output for the SetParameterValues node.
Additionally, I found the Excel file that I assume is the input for the script mentioned above. Is there a way to generate this input using the data I have already gathered in my script? My goal is to have everything in one Excel file instead of multiple files.
Yes give the getparameters script a look, that is the front end of the 2 part workflow. First one gets parameter data and second one takes that same file back in to return the changes.
In the case of your example those inputs aren’t in the form of lists. Hover over the inputs and read the structures they require.
I would suggest breaking your workflow into 3 parts to avoid having to mix family doc/type logic.
This has indeed been the most complex script I’ve worked on so far. I managed to get the workflow running using the Orchid package, but with that method, I’m unable to handle multiple Family documents.
For your information, the basis of my script is your Crumple_AddParameters.dyn script. I tried to expand on it by adding functionality to set values and formulas.
Because its not possible to handle multiple Family Documents I switched to using only the Crumple and Data-Shapes packages. This is where I got stuck and needed help.
Regarding your advice, when I downloaded your Crumple_GetParameterValues.dyn script, it didn’t work for me. I’m using the most recent version of the Crumple package.
When I select the directory path and run the script, the FamilyDoc.GetParameterValues node gives the following outputs. Do you know why this issue is occurring or how it could happen? I haven’t made any changes to the script.
What is your revit build? I will need to test. I still havent had time to test in 2025 if it’s there, hoping to get a chance this month before my revit license expires (potentially not renewing).