# Add Shared Parameter to Project

**URL:** <https://forum.dynamobim.com/t/add-shared-parameter-to-project/8100>\
**Category:** Revit\
**Tags:** revit, archi-lab\
**Created:** [December 8, 2016, 12:28pm UTC](https://forum.dynamobim.com/t/add-shared-parameter-to-project/8100 "2016-12-08T12:28:28Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![Raul.Galdran](https://avatars.discourse-cdn.com/v4/letter/r/7feea3/32.png) [@Raul.Galdran](https://forum.dynamobim.com/u/Raul.Galdran)\
**Post date:** [December 8, 2016, 6:47pm UTC](https://forum.dynamobim.com/t/add-shared-parameter-to-project/8100/16 "2016-12-08T18:47:31Z")

</div>

## Original Topic

About the original topic of the discussion. I just realized that the problem is that im working with new version API 2016 so the code has changed.

@bikashseas @kiknchikn2060

So in the end it worked with this solution that i found in this post:

[http://dynamobim.org/forums/topic/shared-parameter-creation-from-list/](http://dynamobim.org/forums/topic/shared-parameter-creation-from-list/)

Code modified from the Python.Script of the custom node Add Shared Parameter to Project from Archi-lab:

```
def addParam(doc, _paramName, _visible, _instance, _groupName, _paramGroup):
	message = None
	if ParamBindingExists(doc, _paramName, _paramType):
		if not RemoveParamBinding(doc, _paramName, _paramType) == "Success":
			message = "Param Binding Not Removed Successfully"
		else:
			message = None
			
	group = file.Groups.get_Item(_groupName)
	if group == None:
		group = file.Groups.Create(_groupName)	

	if group.Definitions.Contains(group.Definitions.Item[_paramName]):
		_def = group.Definitions.Item[_paramName]
	else:
### _def = group.Definitions.Create(_paramName, _paramType, _visible)
		opt = ExternalDefinitionCreationOptions(_paramName, _paramType)
		opt.Visible = _visible;
		_def = group.Definitions.Create(opt)
		
	param = doc.ParameterBindings.Insert(_def, bind, _paramGroup)
	return message

```

Thanks a lot for you help and time.

---

_[View the full topic](https://forum.dynamobim.com/t/add-shared-parameter-to-project/8100)._
