# Dividing Dynamo Code Parts for Multiple Options

**URL:** <https://forum.dynamobim.com/t/dividing-dynamo-code-parts-for-multiple-options/66791>\
**Category:** Revit\
**Created:** [August 3, 2021, 11:05pm UTC](https://forum.dynamobim.com/t/dividing-dynamo-code-parts-for-multiple-options/66791 "2021-08-03T23:05:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zakim](https://avatars.discourse-cdn.com/v4/letter/z/e47774/32.png) [@zakim](https://forum.dynamobim.com/u/zakim)\
**Post date:** [August 3, 2021, 11:05pm UTC](https://forum.dynamobim.com/t/dividing-dynamo-code-parts-for-multiple-options/66791/1 "2021-08-03T23:05:30Z")

</div>

Hello Everyone,

I am wondering if it is possible to divide a dynamo code to run certain parts of the dynamo code. For example, if the user selects **Option A** then dynamo runs the nodes that belong to **Option A** a routine. If the user selects **Option B** , then dynamo runs the nodes that belong to **Option B** a routine.

… something like that.  
I appreciate any pointers.  
Thanks

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [August 4, 2021, 12:01am UTC](https://forum.dynamobim.com/t/dividing-dynamo-code-parts-for-multiple-options/66791/2 "2021-08-04T00:01:11Z")

</div>

I usually do this by blocking one stream and passing the other using logic gates, see below:

 ![stream logic](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/3/532af749fe1fe9ce1212ba1e9b1fd3ac0465c185.png)

---

<div class="post-metadata">

**Author:** ![se.ha](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@se.ha](https://forum.dynamobim.com/u/se.ha)\
**Post date:** [August 4, 2021, 6:52am UTC](https://forum.dynamobim.com/t/dividing-dynamo-code-parts-for-multiple-options/66791/3 "2021-08-04T06:52:03Z")

</div>

Sometimes I use this really basic definition, which works nicely in Dynamo Player with User Input. You can replace the “True/False” with Text, Number, Dropdown or anything that suits you.

![User Input Options](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/e/be74d65ced666a0aa25d9553329d642708f06c82.png)

---

<div class="post-metadata">

**Author:** ![zakim](https://avatars.discourse-cdn.com/v4/letter/z/e47774/32.png) [@zakim](https://forum.dynamobim.com/u/zakim)\
**Post date:** [August 6, 2021, 3:09pm UTC](https://forum.dynamobim.com/t/dividing-dynamo-code-parts-for-multiple-options/66791/4 "2021-08-06T15:09:28Z")

</div>

Thank you @GavinNicholls and @se.ha for sharing this. It is great help. 🙏  
Both are great solutions.
