# Batch Create Shared Parameters In Families From Directory

**URL:** <https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659>\
**Category:** Uncategorized\
**Tags:** revit, clockwork, rhythm, dynamo, orchid\
**Created:** [March 22, 2022, 4:21pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659 "2022-03-22T16:21:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![waqar.a.khan949](https://avatars.discourse-cdn.com/v4/letter/w/2bfe46/32.png) [@waqar.a.khan949](https://forum.dynamobim.com/u/waqar.a.khan949)\
**Post date:** [March 22, 2022, 4:21pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/1 "2022-03-22T16:21:30Z")

</div>

Hi I have several family documents in a directory, I am trying to first filter them based on the category and a paramater, In the second step I am trying to add shared parameters to these families.

Work Flow Chart:

 ![344](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/6/c6e496318092829d950476ef9f927e2527b99ee1.png)

The script shows no errors but the issues arise, when I check the output. When I open the families it gives me the following error and the parameters are not added.

![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/f/ff5db02c13a32d0693a0711d6a8e129826f3ee88.png)

 ![2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/6/16d6c2852bf6dd4d846e4cc537b5fc8225b9bb58.png)

After I close it and re-open, I can see that the parameters are added. But If I dont save the file it reverts back to the previous version without the parameters.

 ![3](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/d/9d30f2899d5dd2851e9f12094e726555aae2cd8c.png)

 ![4](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/5/0568431301768382f5fd255ba9eb471a85cb3c78.png)

I know the problem is with 2 of the nodes -

“Document.Close” and “Family.Load”

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/e/1e1096a78e8ef57fde880f0a5baca937fea90703.png)

The Graph

 ![344](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/6/c6e496318092829d950476ef9f927e2527b99ee1.png)

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [March 22, 2022, 4:35pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/2 "2022-03-22T16:35:53Z")

</div>

I highly recommend avoiding the opening of files in the background with rhythm or orchid and just use the OOTB nodes to do this on a document by document basis.

This video gives an overview of how to batch simpler graphs over a directory.

[![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/f/9f74af940bf0e5172b2e9b764b7fe700df197b96.jpeg "Dynamo for Revit - Family Document Nodes and Batching Workflows") ](https://www.youtube.com/watch?v=2w29v1pYQlA)

---

<div class="post-metadata">

**Author:** ![waqar.a.khan949](https://avatars.discourse-cdn.com/v4/letter/w/2bfe46/32.png) [@waqar.a.khan949](https://forum.dynamobim.com/u/waqar.a.khan949)\
**Post date:** [March 22, 2022, 4:38pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/3 "2022-03-22T16:38:01Z")

</div>

Thanks for sharing the video. I came across this solution but I am looking to solve issues in the above graph with background open and close. 🙂

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [March 22, 2022, 4:40pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/4 "2022-03-22T16:40:12Z")

</div>

Sounds good. Re: [orchid](https://github.com/erfajo/OrchidForDynamo/issues) the author prefers you ask about his package over on github, but either way good luck with the graph! Perhaps others can chime in here as well.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 22, 2022, 5:13pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/5 "2022-03-22T17:13:11Z")

</div>

I only looked at the first image but it looks like you:

1. Open the `FamilyDocuments` and filter for specific category
2. Load those `Families` and filter `FamilyTypes` by parameters
3. Get the `FamilyDocuments` back from the `FamilyTypes`
4. Add shared parameters to the `FamilyDocuments`

If I had to guess, you’re doing too many things in too many places. Loading the families probably wont let you save the family document since the family is still open. I also don’t think you need to look at each family type since they would still share the same family document if they’re from the same family. Again, you’d be opening and modifying the same document more than once that way.

You should be able to do everything directly in the family document once you’ve opened it. It may require additional packages or the Revit API.

---

<div class="post-metadata">

**Author:** ![waqar.a.khan949](https://avatars.discourse-cdn.com/v4/letter/w/2bfe46/32.png) [@waqar.a.khan949](https://forum.dynamobim.com/u/waqar.a.khan949)\
**Post date:** [March 22, 2022, 5:16pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/6 "2022-03-22T17:16:52Z")

</div>

Thanks @Nick_Boyts for your response. What can be the solution? …

Which node can I use instead of “Family.Load” Or How can I close the loaded families and save after adding the parameter?

What would be the best way to filter the families with category and than with a parameter? After filtering I would like to add the shared parameters also

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 22, 2022, 5:20pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/7 "2022-03-22T17:20:06Z")

</div>

There are custom packages that deal with the `FamilyDocument` environment. I don’t know if they’ll have exactly what you need but it would be a good start. You can still do everything you’re doing in your current graph, you would just have to do it within the family environment. You would likely filter your list of original families into lists of those that do get parameters and those that don’t. You could then close and save or just close those families respectively.

---

<div class="post-metadata">

**Author:** ![waqar.a.khan949](https://avatars.discourse-cdn.com/v4/letter/w/2bfe46/32.png) [@waqar.a.khan949](https://forum.dynamobim.com/u/waqar.a.khan949)\
**Post date:** [March 22, 2022, 5:20pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/8 "2022-03-22T17:20:42Z")

</div>

Can you recommend any such packages?

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [March 22, 2022, 5:21pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/9 "2022-03-22T17:21:57Z")

</div>

[Orchid](https://github.com/erfajo/OrchidForDynamo/issues) is the only one that I can remember off the top of my head.

---

<div class="post-metadata">

**Author:** ![waqar.a.khan949](https://avatars.discourse-cdn.com/v4/letter/w/2bfe46/32.png) [@waqar.a.khan949](https://forum.dynamobim.com/u/waqar.a.khan949)\
**Post date:** [March 22, 2022, 5:23pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/10 "2022-03-22T17:23:14Z")

</div>

I have used [Orchid](https://github.com/erfajo/OrchidForDynamo/issues) nodes that I could find in my graph.

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [March 22, 2022, 5:35pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/11 "2022-03-22T17:35:35Z")

</div>

This might be of use: [Add parameters to Revit families using Dynamo (and Crumple)! - YouTube](https://www.youtube.com/watch?v=lvO2_0IQ8vQ)

It uses the package crumple instead

---

<div class="post-metadata">

**Author:** ![Elie.Trad](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/elie.trad/32/110373_2.png) [@Elie.Trad](https://forum.dynamobim.com/u/Elie.Trad)\
**Post date:** [March 22, 2022, 6:26pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/12 "2022-03-22T18:26:19Z")

</div>

@waqar.a.khan949 once you run the script, why don’t you close Revit then re-open it and check the families? The families are loaded in your Revit project and you are opening them at the same time, see if it helps.

---

<div class="post-metadata">

**Author:** ![waqar.a.khan949](https://avatars.discourse-cdn.com/v4/letter/w/2bfe46/32.png) [@waqar.a.khan949](https://forum.dynamobim.com/u/waqar.a.khan949)\
**Post date:** [March 22, 2022, 6:48pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/13 "2022-03-22T18:48:10Z")

</div>

Hi, Just checked. Doesn’t work. The parameters are not added. I am wondering which node can I use instead of “Family.Load” … Seems like that is causing the issues. I need to get families as elements or elements from the families to filter them with the parameter.

Right now I need to run the script 2 times to make it work.

---

<div class="post-metadata">

**Author:** ![Elie.Trad](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/elie.trad/32/110373_2.png) [@Elie.Trad](https://forum.dynamobim.com/u/Elie.Trad)\
**Post date:** [March 23, 2022, 10:33am UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/14 "2022-03-23T10:33:34Z")

</div>

@waqar.a.khan949 check this out, maybe SaveAs without loading the families will work for you:

> [@Split family types](https://forum.dynamobim.com/t/split-family-types/70547/3):
>
> Maybe something likes this? Packages used Clockwork and Orchid, it was done for only one family, for multiple families maybe a better lists structure is required.

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [March 23, 2022, 11:22am UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/15 "2022-03-23T11:22:59Z")

</div>

You could use this post as a base for following @Nick_Boyts suggested path.

> [@Open Families from a Directory, Purge a Category, Load and Save](https://forum.dynamobim.com/t/open-families-from-a-directory-purge-a-category-load-and-save/26577):
>
> The following graph will load a family from a directory, delete all unused Family and Family Types of a Category, then Save and/or Load the family into the current project. Here is the core code in the “Open Document & Clean” node: import System import clr clr.AddReference("RevitNodes") import Revit clr.AddReference('RevitAPI') from Autodesk.Revit.DB import \* clr.AddReference('RevitServices') import R…

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [March 29, 2022, 1:28pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/18 "2022-03-29T13:28:23Z")

</div>

You really shouldn’t cross post like this - not the way forums are typically used - posts in a thread should relate to posts in that thread. Your threads are visible in the topics board for everyone to see.

---

<div class="post-metadata">

**Author:** ![waqar.a.khan949](https://avatars.discourse-cdn.com/v4/letter/w/2bfe46/32.png) [@waqar.a.khan949](https://forum.dynamobim.com/u/waqar.a.khan949)\
**Post date:** [March 29, 2022, 1:40pm UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/19 "2022-03-29T13:40:24Z")

</div>

Alright Sir 🙂

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [March 30, 2022, 7:32am UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/20 "2022-03-30T07:32:05Z")

</div>

To help you out here in regards to before, I’m also playing with opening/editing/loading families currently. I seem to have managed to get the process to work but am still testing it. This script should open all doors in a project, add a parameter to them, then load them back to the project. Hope it helps give some ideas, it mostly uses Python but also has Clockwork/Crumple in it.

I know the forums generally don’t like background open processes when it comes to families, but it might be helpful. Can’t guarantee it’s 100% perfect, but seems to work for me.

This is just a prototype so I suggest learning more about Python/Revit API if you wish to take it further.

[Open from project add parameter then load.dyn](https://forum.dynamobim.com/uploads/short-url/jpjzDtouLWawL0T5Yd25lwBiHf0.dyn) (27.8 KB)

 ![Open from project add parameter then load_2022-03-30_06-27-26](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/7/e725863bf2803275f60e7ad76f5dba699e915b57.png)

---

<div class="post-metadata">

**Author:** ![waqar.a.khan949](https://avatars.discourse-cdn.com/v4/letter/w/2bfe46/32.png) [@waqar.a.khan949](https://forum.dynamobim.com/u/waqar.a.khan949)\
**Post date:** [March 30, 2022, 7:34am UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/21 "2022-03-30T07:34:09Z")

</div>

Hi Gavin,

I actually solved this issue. Will post the solution here soon. Thanks for helping out

---

<div class="post-metadata">

**Author:** ![Arno\_De\_Lange](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/arno_de_lange/32/35178_2.png) [@Arno\_De\_Lange](https://forum.dynamobim.com/u/Arno_De_Lange)\
**Post date:** [August 3, 2022, 11:12am UTC](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659/23 "2022-08-03T11:12:27Z")

</div>

@GavinNicholls the image you posted comes close to what i need… i just don’t need a shared parameter… just to be able to add some parameters

[Next page](https://forum.dynamobim.com/t/batch-create-shared-parameters-in-families-from-directory/74659.md?page=2)
