# Set parameter by name, using API

**URL:** <https://forum.dynamobim.com/t/set-parameter-by-name-using-api/25113>\
**Category:** Revit\
**Created:** [August 22, 2018, 2:15pm UTC](https://forum.dynamobim.com/t/set-parameter-by-name-using-api/25113 "2018-08-22T14:15:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![YRioux](https://avatars.discourse-cdn.com/v4/letter/y/c89c15/32.png) [@YRioux](https://forum.dynamobim.com/u/YRioux)\
**Post date:** [August 22, 2018, 2:15pm UTC](https://forum.dynamobim.com/t/set-parameter-by-name-using-api/25113/1 "2018-08-22T14:15:23Z")

</div>

Hi,  
how can I set a parameter by his name using the Revit API? I actually want to modify the value to one of the parameter of my FamilyType.

(I try to code exactly what the SetParameterByName note does)

Thanks!

---

<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:** [August 22, 2018, 3:31pm UTC](https://forum.dynamobim.com/t/set-parameter-by-name-using-api/25113/2 "2018-08-22T15:31:50Z")

</div>

Hi,

This was already exposed in the forum :

```
import clr

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
doc = DocumentManager.Instance.CurrentDBDocument

elements=IN[0]
parameter_names = IN[1]
values = IN[2]

for e, v in zip(elements, values):
	e.SetParameterByName(parameter_names,v)
#Assign your output to the OUT variable.
OUT = elements

```

 ![Setparameter](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/7/477394eb4782742dba419bda51d1c631f54eb769.png)

---

<div class="post-metadata">

**Author:** ![YRioux](https://avatars.discourse-cdn.com/v4/letter/y/c89c15/32.png) [@YRioux](https://forum.dynamobim.com/u/YRioux)\
**Post date:** [August 22, 2018, 4:17pm UTC](https://forum.dynamobim.com/t/set-parameter-by-name-using-api/25113/3 "2018-08-22T16:17:20Z")

</div>

I’ve tried this one, but ‘elements’ for me are FamilyType and the error says that FamilySymbol (my family type) doesn’t have the argument SetParameterByName

---

<div class="post-metadata">

**Author:** ![YRioux](https://avatars.discourse-cdn.com/v4/letter/y/c89c15/32.png) [@YRioux](https://forum.dynamobim.com/u/YRioux)\
**Post date:** [August 22, 2018, 4:20pm UTC](https://forum.dynamobim.com/t/set-parameter-by-name-using-api/25113/4 "2018-08-22T16:20:10Z")

</div>

\*attribute

---

<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:** [August 22, 2018, 4:29pm UTC](https://forum.dynamobim.com/t/set-parameter-by-name-using-api/25113/5 "2018-08-22T16:29:04Z")

</div>

SetParameter works with elements :

 ![Family%20type](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/9/39e74f6c0c54fffc225da44da8120ea8df46837f.png)

If you want to SetParameter inside a family, you can use the node from Orchid Package.  
 ![Family%20SetParameter](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/9/3996a5d4caf69a3067d051ac55d9a93b3578c0e1.png)

---

<div class="post-metadata">

**Author:** ![lkichenin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/lkichenin/32/96679_2.png) [@lkichenin](https://forum.dynamobim.com/u/lkichenin)\
**Post date:** [August 23, 2018, 6:37am UTC](https://forum.dynamobim.com/t/set-parameter-by-name-using-api/25113/6 "2018-08-23T06:37:45Z")

</div>

You need to post a snippet of your code so we can investigate where the issue is coming from.

We cannot do that with your description only.

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [August 23, 2018, 3:45pm UTC](https://forum.dynamobim.com/t/set-parameter-by-name-using-api/25113/7 "2018-08-23T15:45:53Z")

</div>

Maybe this?

| ![Public method](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/3X/f/3/f3b4919b79f344cc0fe771745dce204d28fe0b8d.gif)|[ChangeTypeId(ElementId)](http://www.revitapidocs.com/2018/479b5d94-abd3-db42-27d7-6a3eda12f285.htm)|Changes the type of the element.

| (Inherited from [Element](http://www.revitapidocs.com/2018/eb16114f-69ea-f4de-0d0d-f7388b105a16.htm).) |
| --- |

If not it might help you identify an alternative solution…

[http://www.revitapidocs.com/2018/f4f2420f-bba6-dac2-9b93-4e55a58d1375.htm](http://www.revitapidocs.com/2018/f4f2420f-bba6-dac2-9b93-4e55a58d1375.htm)

Hope that’s useful…

Mark
