# Shared Parameter Creation from list

**URL:** <https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048>\
**Category:** Packages\
**Created:** [August 28, 2015, 1:12pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048 "2015-08-28T13:12:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danny\_Jones](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@Danny\_Jones](https://forum.dynamobim.com/u/Danny_Jones)\
**Post date:** [August 28, 2015, 1:12pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/1 "2015-08-28T13:12:40Z")

</div>

Is there any way to feed in a list to the Add shared parameter to Project node? I’ve got a list of 125 parameters that we use for room data sheets but i’d like an automated way to add them to the project. Any thoughts?

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [August 29, 2015, 6:36pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/2 "2015-08-29T18:36:39Z")

</div>

Danny,

I thought it worked with list input:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/2/28def031a0b844b54849a47220eeff2e45cb5f41.png)

---

<div class="post-metadata">

**Author:** ![Danny\_Jones](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@Danny\_Jones](https://forum.dynamobim.com/u/Danny_Jones)\
**Post date:** [August 31, 2015, 7:09am UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/3 "2015-08-31T07:09:40Z")

</div>

Thanks for the response Konrad. Unfortunately I just get a null. Thoughts??

![Shared](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/e/e3666fe82c094783985079511973fd3accb97152.png)

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [August 31, 2015, 7:42am UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/4 "2015-08-31T07:42:13Z")

</div>

What you doing is not the same or even close to what I sent you an image of. Please try again.

---

<div class="post-metadata">

**Author:** ![Danny\_Jones](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@Danny\_Jones](https://forum.dynamobim.com/u/Danny_Jones)\
**Post date:** [August 31, 2015, 9:20am UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/5 "2015-08-31T09:20:45Z")

</div>

For anyone wondering…you need to pipe in true/false statements for however many parameters you have and it works great.

---

<div class="post-metadata">

**Author:** ![Isaac\_Smith](https://avatars.discourse-cdn.com/v4/letter/i/b5ac83/32.png) [@Isaac\_Smith](https://forum.dynamobim.com/u/Isaac_Smith)\
**Post date:** [October 19, 2015, 8:48am UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/6 "2015-10-19T08:48:51Z")

</div>

I’m new to dynamo and hoping someone can help me figure out what 'm doing wrong. I am trying to get the “Add Shared Parameter to Project” node working. Currently it is returning null every time. When I run it is complete with out warnings, adds the parameter group to the shared parameters file but not that actual parameter. Nothing ever seems to hit the project document. When I tried with an existing shared parameter nothing happened. What did I mess up?

&nbsp;

![Add Shared Parameter](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/e/e974ec04db489cbd0edc25f0ec87d315dcc3ab98.jpg)

---

<div class="post-metadata">

**Author:** ![Roman\_Sevostianov](https://avatars.discourse-cdn.com/v4/letter/r/a6a055/32.png) [@Roman\_Sevostianov](https://forum.dynamobim.com/u/Roman_Sevostianov)\
**Post date:** [December 17, 2015, 3:55pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/7 "2015-12-17T15:55:28Z")

</div>

Hello,

I’m in the same boat as Isaac, null every time. Only difference, for me it only adds the group name to the shared parameters file, but no parameters.

Appreciate any help, thank you.

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/deeb6263dace9d3c2f4d4e9f4bf6a1cb145f6b15.jpg)

---

<div class="post-metadata">

**Author:** ![Nick\_Martin](https://avatars.discourse-cdn.com/v4/letter/n/85e7bf/32.png) [@Nick\_Martin](https://forum.dynamobim.com/u/Nick_Martin)\
**Post date:** [December 18, 2015, 11:50am UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/8 "2015-12-18T11:50:41Z")

</div>

Here is a definition I made not too long ago. Only real difference is I’m feeding in an excel list of parameter names. If you are getting nulls make sure a shared parameter file exists. If the shared parameter .txt file isn’t there the definition will error out.

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/a/a18d7ad5db4a1b40be28eee3885268e32a1496c0.png)

---

<div class="post-metadata">

**Author:** ![James\_Guse](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@James\_Guse](https://forum.dynamobim.com/u/James_Guse)\
**Post date:** [January 14, 2016, 12:01pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/9 "2016-01-14T12:01:34Z")

</div>

I’m in the same boat as Roman; my shared parameters file exists; the group is created but not the parameter; return is null.

I’m sure I can work the input and matrix manipulation to process lists once I can work out what I’m doing wrong with the node itself…

If anyone has any ideas that would be great.

 ![dynamo_output](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/e/ed9f8646bdee96c0848bf2b622915c56423333fa.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Martin](https://avatars.discourse-cdn.com/v4/letter/n/85e7bf/32.png) [@Nick\_Martin](https://forum.dynamobim.com/u/Nick_Martin)\
**Post date:** [January 14, 2016, 5:20pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/10 "2016-01-14T17:20:00Z")

</div>

While I’m not certain, I think the “Add Shared Parameter to Project” custom node does not like the “Parameter Types” and “Parameter Groups” drop down nodes. For some reason I don’t have them in my Dynamo to test. I’d suggest formatting your definition as Konrad described or how I did mine using the custom nodes from his Archi-Lab package. That’s the only common thing I see with those who get the groups but not the parameters…using a combination of the custom parameter nodes and the drop downs.

---

<div class="post-metadata">

**Author:** ![James\_Guse](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@James\_Guse](https://forum.dynamobim.com/u/James_Guse)\
**Post date:** [January 18, 2016, 12:30pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/11 "2016-01-18T12:30:21Z")

</div>

Thanks for the reply, Nick.

I’m really not having any luck at all with this.

I’ve tried a few things; with an empty shared parameters file I’ll get the group added, but no other changes. No project parameters get added, everything returns ‘null’.

Regardless of using a list or an individual item for testing, the result is the same. Extracting the active python script is a little more descriptive, but still beyond me…

&nbsp;

If anyone has any advice, I’d appreciate it.

&nbsp;

 ![dynamo_output](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/f/f38aa955098582d69ea942fae84a4b3713d690ac.png) ![python error](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/d85a1a5301588611e3bfa00e4a62a61fd47eb40d.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Martin](https://avatars.discourse-cdn.com/v4/letter/n/85e7bf/32.png) [@Nick\_Martin](https://forum.dynamobim.com/u/Nick_Martin)\
**Post date:** [January 18, 2016, 2:57pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/12 "2016-01-18T14:57:09Z")

</div>

Just discovered my definition is broken in Revit 2016. Feeding a single shared parameter or a group of them results in nulls. Not sure what changed between 2015 and 2016 to break it.

---

<div class="post-metadata">

**Author:** ![Milorad\_Lazicic](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/milorad_lazicic/32/18280_2.png) [@Milorad\_Lazicic](https://forum.dynamobim.com/u/Milorad_Lazicic)\
**Post date:** [February 1, 2016, 5:41pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/13 "2016-02-01T17:41:01Z")

</div>

it worked for me as described from Konrad. the drop down nodes for “Parameter Types” and “Parameter Groups” does not work. for “Parameter Types” and “Parameter Groups” you could use the python scripts from Konrad.

@Konrad: Thanks!

Cheers, Milorad

&nbsp;

Code for the Parameter Type node:

#Copyright© 2015, Konrad Sobon

# @arch\_laboratory, [http://archi-lab.net](http://archi-lab.net)

import clr  
clr.AddReference(“ProtoGeometry”)  
from Autodesk.DesignScript.Geometry import \*

# Import DocumentManager and TransactionManager

clr.AddReference(“RevitServices”)  
import RevitServices  
from RevitServices.Persistence import DocumentManager  
from RevitServices.Transactions import TransactionManager

# Import RevitAPI

clr.AddReference(“RevitAPI”)  
import Autodesk  
from Autodesk.Revit.DB import \*  
import System

#Assign your output to the OUT variable  
OUT = System.Enum.GetValues(ParameterType)

&nbsp;

&nbsp;

Code for the Parameter Group node:

#Copyright© 2015, Konrad Sobon

# @arch\_laboratory, [http://archi-lab.net](http://archi-lab.net)

import clr  
clr.AddReference(“ProtoGeometry”)  
from Autodesk.DesignScript.Geometry import \*

# Import DocumentManager and TransactionManager

clr.AddReference(“RevitServices”)  
import RevitServices  
from RevitServices.Persistence import DocumentManager  
from RevitServices.Transactions import TransactionManager

# Import RevitAPI

clr.AddReference(“RevitAPI”)  
import Autodesk  
from Autodesk.Revit.DB import \*  
import System

#Assign your output to the OUT variable  
OUT = System.Enum.GetValues(BuiltInParameterGroup)

---

<div class="post-metadata">

**Author:** ![Ben\_Osborne](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ben_osborne/32/17366_2.png) [@Ben\_Osborne](https://forum.dynamobim.com/u/Ben_Osborne)\
**Post date:** [February 3, 2016, 8:46am UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/14 "2016-02-03T08:46:51Z")

</div>

Konrad-

Couple of questions on the archi-lab Add Shared Parameter node Python script:

1. Is there any way to bypass the Shared Parameter File that is set in the Revit Instance and insert a static file path? I would like to point to a consistent shared parameter file on my server to look for certain parameters, and my users might have switched to a different shared parameter file for one reason or another. Alternatively, is it possible to hard-code a shared parameter into the script (GUID, name, ParameterType, Visible) and bypass the Shared Parameter File Lookup altogether?

2. Is there any way to set the parameter “Aligned By Group Type / Vary By Group Instance” setting when adding the parameter? I would guess it would exist somewhere in the parameter bindings, but I couldn’t find anything that made that available.

Also, I modified the python script for my purposes to allow for a parameter to be mapped to multiple revit element categories (inputing a list of categories for one single parameter). Is this the best way to accomplish this? See below:

_cats = app.Create.NewCategorySet()_

_for categ in \_category:_

_builtInCategory = System.Enum.ToObject(BuiltInCategory, [categ.Id](http://categ.Id))_

_cats.Insert(doc.Settings.Categories.get\_Item(builtInCategory))_

_if \_instance:_

_bind = app.Create.NewInstanceBinding(cats)_

_else:_

_bind = app.Create.NewTypeBinding(cats)_

&nbsp;

Thanks-

---

<div class="post-metadata">

**Author:** ![Ben\_Osborne](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ben_osborne/32/17366_2.png) [@Ben\_Osborne](https://forum.dynamobim.com/u/Ben_Osborne)\
**Post date:** [February 10, 2016, 2:16pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/15 "2016-02-10T14:16:03Z")

</div>

I found an answer to how to change the “Vary Between Groups” behavior. See image below:

![VaryBetweenGroups](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/1X/a66edcdf7cc8e752d563510e32920cce6c60dba8.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Martin](https://avatars.discourse-cdn.com/v4/letter/n/85e7bf/32.png) [@Nick\_Martin](https://forum.dynamobim.com/u/Nick_Martin)\
**Post date:** [February 10, 2016, 4:00pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/16 "2016-02-10T16:00:06Z")

</div>

I’m still having issues getting this to work in Revit 2016. Same definition (as I posted above) works fine in Revit 2015. Using Dynamo 0.9.1.3503 for both versions of Revit.

&nbsp;

If I feed in a list of shared parameters I get this traceback:

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.  
Traceback (most recent call last):  
File “\<string\>”, line 107, in \<module\>  
File “\<string\>”, line 78, in addParam  
TypeError: Item() argument after \* must be a sequence, not NoneType

&nbsp;

If I feed in 1 shared parameter I get this traceback:

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.  
Traceback (most recent call last):  
File “\<string\>”, line 107, in \<module\>  
File “\<string\>”, line 81, in addParam  
TypeError: Create() takes exactly 1 argument (3 given)

&nbsp;

Is anyone experiencing this in 2016?

---

<div class="post-metadata">

**Author:** ![Vo\_Minh\_Doan](https://avatars.discourse-cdn.com/v4/letter/v/9e8a1a/32.png) [@Vo\_Minh\_Doan](https://forum.dynamobim.com/u/Vo_Minh_Doan)\
**Post date:** [February 26, 2016, 2:13am UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/17 "2016-02-26T02:13:16Z")

</div>

Hi Konrad and all masters!

I used Add Shared Parameter for Project Node. I found it worked exactly when the input was instance (not a list or array). But when the input were List like your post above and input for isinstance? was {false, true, false}, the result was wrong?

I realized that when we worked with list the is\_instance were alway “Yes”

Can you help with this problem?

Thanks!

 ![Shareparameter](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/1X/dca2b4a8dfd29fef7066626db3ae0310f15a0444.png)

---

<div class="post-metadata">

**Author:** ![Vo\_Minh\_Doan](https://avatars.discourse-cdn.com/v4/letter/v/9e8a1a/32.png) [@Vo\_Minh\_Doan](https://forum.dynamobim.com/u/Vo_Minh_Doan)\
**Post date:** [February 26, 2016, 3:14am UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/18 "2016-02-26T03:14:08Z")

</div>

Dear all!

I tried to revise the script and get the exact result.

![Shareparameter2](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/1X/c5f8f1327d50b5a92cb5abd195410a4c51e3cb5e.png)

---

<div class="post-metadata">

**Author:** ![Sergey\_Krivoy](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@Sergey\_Krivoy](https://forum.dynamobim.com/u/Sergey_Krivoy)\
**Post date:** [March 24, 2016, 4:30pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/19 "2016-03-24T16:30:55Z")

</div>

Hi, Nick!

The method “Autodesk.Revit.DB.Definitions.Create(string, Autodesk.Revit.DB.ParameterType, bool)” was deleted in API 2016. Read more here: [https://github.com/jeremytammik/RevitLookup/blob/master/CS/Test/SDKSamples/FireRating/SharedParam.cs#L74](https://github.com/jeremytammik/RevitLookup/blob/master/CS/Test/SDKSamples/FireRating/SharedParam.cs#L74)

We decided the problem as follows (Multiple Category is also implemented):

![Python_Add_Parameters](http://dynamobim.org/wp-content/uploads/forum-assets/sergeykrivoylist-ru/03/24/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA.jpg)

---

<div class="post-metadata">

**Author:** ![Sergey\_Krivoy](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@Sergey\_Krivoy](https://forum.dynamobim.com/u/Sergey_Krivoy)\
**Post date:** [March 25, 2016, 1:22pm UTC](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048/20 "2016-03-25T13:22:26Z")

</div>

Pardon me, there is a remark: we can not add multiple categories to a single parameter, only different categories to different parameters. We need to think about it.

[Next page](https://forum.dynamobim.com/t/shared-parameter-creation-from-list/2048.md?page=2)
