# FamilyDocument.AddSharedParameter Errors

**URL:** <https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460>\
**Category:** Packages\
**Tags:** orchid\
**Created:** [July 5, 2018, 10:25pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460 "2018-07-05T22:25:02Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveBennettTD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/stevebennetttd/32/50866_2.png) [@SteveBennettTD](https://forum.dynamobim.com/u/SteveBennettTD)\
**Post date:** [July 5, 2018, 10:25pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/1 "2018-07-05T22:25:02Z")

</div>

I’ve tried several options and can’t get past this error. Using Rhythm and Orchid latest builds on Dynamo 2.0.1 in Revit 2018.3.1. What could cause the displayed error? I need this node to close the background opened docs and save the families it opens…  
@john_pierson@erfajo

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/6/060ac001e5424c20112fb19104ddcb4124a07520.png)

---

<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:** [July 5, 2018, 10:26pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/2 "2018-07-05T22:26:57Z")

</div>

Your AddSharedParameter node is missing inputs.

---

<div class="post-metadata">

**Author:** ![SteveBennettTD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/stevebennetttd/32/50866_2.png) [@SteveBennettTD](https://forum.dynamobim.com/u/SteveBennettTD)\
**Post date:** [July 5, 2018, 10:28pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/3 "2018-07-05T22:28:09Z")

</div>

I had those inputs plugged with code at one point, but that introduced other errors on that particular node. With them missing the inputs, no warning is displayed which leads me to believe its working without that info…

---

<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:** [July 5, 2018, 10:36pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/4 "2018-07-05T22:36:16Z")

</div>

It’s not really. Your output is a Function not an actual object. It’s not really _failing_ but it’s incomplete. There should be built in nodes (originally from Archi-lab) specifically for those inputs if you’re having trouble.

---

<div class="post-metadata">

**Author:** ![SteveBennettTD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/stevebennetttd/32/50866_2.png) [@SteveBennettTD](https://forum.dynamobim.com/u/SteveBennettTD)\
**Post date:** [July 5, 2018, 10:44pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/5 "2018-07-05T22:44:09Z")

</div>

So when I plug in “type”, I get the following error:  
This SP was built as a material param, this shouldn’t be controllable…  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/4/24c661dcea43131cf2532264f0fdaba1a7c4be1e.png)

---

<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:** [July 5, 2018, 11:00pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/6 "2018-07-05T23:00:47Z")

</div>

The `group` inputs have “PG\_” in front of them. I think you’re looking for PG\_MATERIALS.  
Look at some of the other posts for examples.  
[https://forum.dynamobim.com/t/add-shared-parameters-to-some-families-orchid-package/21254/11](https://forum.dynamobim.com/t/add-shared-parameters-to-some-families-orchid-package/21254/11)

---

<div class="post-metadata">

**Author:** ![SteveBennettTD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/stevebennetttd/32/50866_2.png) [@SteveBennettTD](https://forum.dynamobim.com/u/SteveBennettTD)\
**Post date:** [July 5, 2018, 11:48pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/7 "2018-07-05T23:48:38Z")

</div>

I’ve tried PG\_Material PG\_Materials PG\_MATERIAL PG\_MATERIALS for “group” code. I’ve tried putting PG\_ in front of GroupName, Type, Group & Instance - I get the same error back each time of Invalid Parameter Type.

---

<div class="post-metadata">

**Author:** ![SteveBennettTD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/stevebennetttd/32/50866_2.png) [@SteveBennettTD](https://forum.dynamobim.com/u/SteveBennettTD)\
**Post date:** [July 6, 2018, 12:11am UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/8 "2018-07-06T00:11:56Z")

</div>

Just for fun (not), I created a new Shared Parameter file just to see if it was my SP file causing issues. Same problem. I even removed the prefix "_TD" from the SP Group name in the event it was messing with the PG_ prefix - same problem.

---

<div class="post-metadata">

**Author:** ![SteveBennettTD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/stevebennetttd/32/50866_2.png) [@SteveBennettTD](https://forum.dynamobim.com/u/SteveBennettTD)\
**Post date:** [July 6, 2018, 3:53pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/10 "2018-07-06T15:53:32Z")

</div>

Thanks @erfajo - following the layout as you have it works like a charm. Setting the code block for //Parameter Group to “PG\_MATERIALS” placed the shared parameters in the Revit category “Materials and Finishes” as desired. Since this obviously doesn’t follow the name displayed in Revit, do you have a listing of each of the different parameter groups or a way to define the logic used to extrapolate how a name is derived for input here?

Also, if I have 3 sets of parameters to add, one set to Materials and Finishes, one set to Identity Data and one to Other, can I have one Dynamo file that runs all 3 sets at once, just as 3 separate groups?

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

---

<div class="post-metadata">

**Author:** ![SteveBennettTD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/stevebennetttd/32/50866_2.png) [@SteveBennettTD](https://forum.dynamobim.com/u/SteveBennettTD)\
**Post date:** [July 6, 2018, 4:55pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/12 "2018-07-06T16:55:20Z")

</div>

Thanks again for the follow up, I found the built-in node you mentioned and that has most of them. One group we use that I didn’t see an equivalent for in the list is “Other”. Is there no way to assign a parameter to this group?

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [July 6, 2018, 7:49pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/13 "2018-07-06T19:49:47Z")

</div>

Hi,  
The ParameterGroup for Other you are looking for is “INVALID”. The name is quite strange indeed.

![Other](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/3/a3820ae1007a1c7299ebf68b3eb37a0022e69703.png)

---

<div class="post-metadata">

**Author:** ![SteveBennettTD](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/stevebennetttd/32/50866_2.png) [@SteveBennettTD](https://forum.dynamobim.com/u/SteveBennettTD)\
**Post date:** [July 9, 2018, 3:23pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/14 "2018-07-09T15:23:42Z")

</div>

Thanks @Alban_de_Chasteigner - I was avoiding that since I was unsure what would happen using it!

---

<div class="post-metadata">

**Author:** ![bwesley](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@bwesley](https://forum.dynamobim.com/u/bwesley)\
**Post date:** [January 10, 2019, 11:04pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/15 "2019-01-10T23:04:33Z")

</div>

Hi everyone! I am new to the community but have been browsing for a little while.

I am having the issue shown by the original poster in that the Document.Close node is reporting the wrong input type from Parameter.AddSharedParameter (it should be ‘document’ but instead is ‘function’.)

When I run the script, it seems to work. All of the files rapidly open and close until they’re all done, then after a few seconds the script ends and the error/warning is shown. When I open the files, the shared parameter hasn’t been added.

I’ve downloaded the script posted by @erfajo and have changed the inputs to match what I am trying to do however I still get the same error. I am using “INVALID” as the parameter group (“Other”) but have also tried others, including “PG\_MATERIALS” but still get the error.

Can somebody please help me and let me know what I am doing wrong? Is there perhaps an add-in that I do not have? I am using Orchid and Rhythm with Dynamo 2.0.2/Revit 2019.

Thanks!

 ![documentfunctionerror](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/a/3a25bcc3e86d10b35a2e47bede719b77109c507a.jpeg)

---

<div class="post-metadata">

**Author:** ![bwesley](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@bwesley](https://forum.dynamobim.com/u/bwesley)\
**Post date:** [January 13, 2019, 10:02pm UTC](https://forum.dynamobim.com/t/familydocument-addsharedparameter-errors/23460/17 "2019-01-13T22:02:47Z")

</div>

Thanks for your help @erfajo ! I managed to get it working now through a couple of simple steps. I had to set the default value for the tooltip as you mentioned. Also, because I have multiple shared parameters with different parameter types, I had to create a second ‘add shared parameter’ node to pass in the different parameter type.

Now, the above worked but it would only actually save the parameters in the first document that was opened and none of the others (even though it would rapidly open and close them all). So I implemented the “await” node which seemed to work! Now I can easily add the shared parameters to all of the families with a single click!

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/5/9588eef0b817a2fc67038b0e63a32db17e45cb21.png)
