# Changing Family Based on Parameter Value

**URL:** <https://forum.dynamobim.com/t/changing-family-based-on-parameter-value/16147>\
**Category:** Uncategorized\
**Created:** [November 1, 2017, 2:07pm UTC](https://forum.dynamobim.com/t/changing-family-based-on-parameter-value/16147 "2017-11-01T14:07:05Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Ewan\_Opie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ewan_opie/32/77070_2.png) [@Ewan\_Opie](https://forum.dynamobim.com/u/Ewan_Opie)\
**Post date:** [November 4, 2017, 5:10am UTC](https://forum.dynamobim.com/t/changing-family-based-on-parameter-value/16147/8 "2017-11-04T05:10:46Z")

</div>

Righto, I knew I had seen something like this before.

I’ve just typed this out on my phone but it should be able to be adapted for your purpose @robertsb2010

Example:

X=input list of values  
a=family type 1 for values 0 to 100  
b=family type 2 for values 101 to 200  
c=family type 3 for values 201 to 300  
d=family type 4 for values 3011 to 400

The code block contents:

```
x>=0&&x<=100 ?
a:
x>=101&&x<=200 ?
b:
x>=201&&x<=300 ?
c:
x>=301&&x<=400 ?
d:
"Out of range";

```

The inspiration:

> [@If ( then , else) in dynamo](https://forum.dynamobim.com/t/if-then-else-in-dynamo/2556/6):
>
> Konrad, Michael, Many thanks. Managed to make it work! And the code block processes a list of 100+ values in seconds, when some of the monstrosities I’ve built out of nodes took ages! Just goes to show the inherent inefficiency of visual programming I guess. The end result looks like this: [Capture3] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Best Regards.

I’ll still see if my OOTB node solution idea works on Monday. 🙂

---

_[View the full topic](https://forum.dynamobim.com/t/changing-family-based-on-parameter-value/16147)._
