# Any news for setting global parameters?

**URL:** <https://forum.dynamobim.com/t/any-news-for-setting-global-parameters/7850>\
**Category:** FAQ\
**Created:** [November 30, 2016, 9:06am UTC](https://forum.dynamobim.com/t/any-news-for-setting-global-parameters/7850 "2016-11-30T09:06:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali.safiaddine](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ali.safiaddine/32/17048_2.png) [@ali.safiaddine](https://forum.dynamobim.com/u/ali.safiaddine)\
**Post date:** [November 30, 2016, 9:06am UTC](https://forum.dynamobim.com/t/any-news-for-setting-global-parameters/7850/1 "2016-11-30T09:06:57Z")

</div>

Hi guys,

Until now all topics talking about global parameters is talking about how to read the values of global parameters,

any news on how we can set these values and change them?

---

<div class="post-metadata">

**Author:** ![Mostafa\_El\_Ayoubi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mostafa_el_ayoubi/32/7815_2.png) [@Mostafa\_El\_Ayoubi](https://forum.dynamobim.com/u/Mostafa_El_Ayoubi)\
**Post date:** [November 30, 2016, 1:20pm UTC](https://forum.dynamobim.com/t/any-news-for-setting-global-parameters/7850/2 "2016-11-30T13:20:25Z")

</div>

Try this code : IN[0] is the name of the global parameter you wish to change and IN[1] is the new value . It should work for all parameter types:

```
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit import DB as db

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

doc = DocumentManager.Instance.CurrentDBDocument

filter = db.FilteredElementCollector(doc).OfClass(db.GlobalParameter)
gp = [UnwrapElement(p) for p in filter if UnwrapElement(p).Name == IN[0]][0]

#getting the right ParameterValue constructor :
methodname = gp.GetValue().GetType().ToString().rsplit('.',1)[-1]

TransactionManager.Instance.EnsureInTransaction(doc)
try:
	#setting the parameter with the right parametervalue constructor
	gp.SetValue(getattr(db,methodname)(IN[1]))
	out = 'success'
except:
	out = 'failed, check if the parameter value is the right type'

TransactionManager.Instance.TransactionTaskDone()

OUT = out

```

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/8/48b4f2573ca6e45b0c9a73205f1c2a164c5cb131.gif)

---

<div class="post-metadata">

**Author:** ![ali.safiaddine](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ali.safiaddine/32/17048_2.png) [@ali.safiaddine](https://forum.dynamobim.com/u/ali.safiaddine)\
**Post date:** [November 30, 2016, 3:11pm UTC](https://forum.dynamobim.com/t/any-news-for-setting-global-parameters/7850/3 "2016-11-30T15:11:07Z")

</div>

Hi @Mostafa_El_Ayoubi thank you for replying and this is what am searching for 🙂

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [November 30, 2016, 3:15pm UTC](https://forum.dynamobim.com/t/any-news-for-setting-global-parameters/7850/4 "2016-11-30T15:15:17Z")

</div>

Looks like something is in the works on OOTB Dynamo as well:

> <https://github.com/DynamoDS/DynamoRevit/pull/1340>

---

<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:** [November 30, 2016, 3:27pm UTC](https://forum.dynamobim.com/t/any-news-for-setting-global-parameters/7850/5 "2016-11-30T15:27:14Z")

</div>

Closed on November 30, 2016, 3:27pm UTC


