# Family Editor: Set yes/no parameters for all Types

**URL:** <https://forum.dynamobim.com/t/family-editor-set-yes-no-parameters-for-all-types/16092>\
**Category:** Developers\
**Tags:** revit, dynamo, api\
**Created:** [October 31, 2017, 6:15am UTC](https://forum.dynamobim.com/t/family-editor-set-yes-no-parameters-for-all-types/16092 "2017-10-31T06:15:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![salvatoredragotta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/salvatoredragotta/32/10078_2.png) [@salvatoredragotta](https://forum.dynamobim.com/u/salvatoredragotta)\
**Post date:** [October 31, 2017, 6:15am UTC](https://forum.dynamobim.com/t/family-editor-set-yes-no-parameters-for-all-types/16092/1 "2017-10-31T06:15:26Z")

</div>

Hi All,

I’m trying to set some Yes/No Parameters for all types in the family editor but just the current type gets changed.

Any idea why?

This is the code:

```
import clr

# 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 *

doc = DocumentManager.Instance.CurrentDBDocument

mgr = doc.FamilyManager

TransactionManager.Instance.EnsureInTransaction(doc)

Types=list(mgr.Types)

_Parameters=FamilyManager.GetParameters(mgr)

for i in Types:
	for j in _Parameters:
		FamilyManager.Set(mgr,j, 0)		
		

TransactionManager.Instance.TransactionTaskDone()

OUT=0
```

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 31, 2017, 7:23am UTC](https://forum.dynamobim.com/t/family-editor-set-yes-no-parameters-for-all-types/16092/2 "2017-10-31T07:23:57Z")

</div>

Did you make sure that all parameters were booleans?

---

<div class="post-metadata">

**Author:** ![salvatoredragotta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/salvatoredragotta/32/10078_2.png) [@salvatoredragotta](https://forum.dynamobim.com/u/salvatoredragotta)\
**Post date:** [October 31, 2017, 11:25am UTC](https://forum.dynamobim.com/t/family-editor-set-yes-no-parameters-for-all-types/16092/3 "2017-10-31T11:25:01Z")

</div>

Yes they are. It works just for the current type. I need to manually switch type if I want to run the script to the next one.

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [October 31, 2017, 12:36pm UTC](https://forum.dynamobim.com/t/family-editor-set-yes-no-parameters-for-all-types/16092/4 "2017-10-31T12:36:36Z")

</div>

"_FamilyManager.Set is used to set the value of a parameter for the current family type_"  
From this page:

> **[Set Family Parameter Requires Type](http://thebuildingcoder.typepad.com/blog/2011/11/set-family-parameter-requires-type.html)**
>
> I was running down to town to have tea with my friend Otto on Saturday morning, and happened to see this autumn leaf lying on the ground. Turned back, picked it up, and made a picture of it in the sunshine on Otto's veranda. It is completely...

---

<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:** [October 31, 2017, 1:38pm UTC](https://forum.dynamobim.com/t/family-editor-set-yes-no-parameters-for-all-types/16092/5 "2017-10-31T13:38:02Z")

</div>

Now you just need to add a line to set the current type for every type in the family.  
[http://www.revitapidocs.com/2018/3d37cd81-48ba-4011-82bc-dbb7ae14b270.htm](http://www.revitapidocs.com/2018/3d37cd81-48ba-4011-82bc-dbb7ae14b270.htm)

---

<div class="post-metadata">

**Author:** ![Gui\_Talarico](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gui_talarico/32/10887_2.png) [@Gui\_Talarico](https://forum.dynamobim.com/u/Gui_Talarico)\
**Post date:** [October 31, 2017, 1:41pm UTC](https://forum.dynamobim.com/t/family-editor-set-yes-no-parameters-for-all-types/16092/6 "2017-10-31T13:41:52Z")

</div>

Try setting each type to current before setting params.  
Looks like you are iterating over types but not doing anything with them:

```
for i in Types
    doc.FamilyManager.CurrentType = i 
        for... # iterate and set param values
```

---

<div class="post-metadata">

**Author:** ![salvatoredragotta](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/salvatoredragotta/32/10078_2.png) [@salvatoredragotta](https://forum.dynamobim.com/u/salvatoredragotta)\
**Post date:** [October 31, 2017, 10:06pm UTC](https://forum.dynamobim.com/t/family-editor-set-yes-no-parameters-for-all-types/16092/7 "2017-10-31T22:06:42Z")

</div>

Thanks!
