# Select element by host

**URL:** <https://forum.dynamobim.com/t/select-element-by-host/89942>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [May 23, 2023, 11:20am UTC](https://forum.dynamobim.com/t/select-element-by-host/89942 "2023-05-23T11:20:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nedelea.rares](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nedelea.rares](https://forum.dynamobim.com/u/nedelea.rares)\
**Post date:** [May 23, 2023, 11:20am UTC](https://forum.dynamobim.com/t/select-element-by-host/89942/1 "2023-05-23T11:20:44Z")

</div>

Hello,  
I try to make a script that will select hosted element using host parameter value. The problem that I encounter is that I only managed to select all element (of all types) hosted on an element or only the last element placed. What I want is to select all element of a specified type. Below you could find my script at this moment.

 ![Select by Host_2023-05-23_02-00-54](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/d/0d651fa1bdea54feeaa8cf84a43f700590855cf3.png)

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [May 24, 2023, 9:29am UTC](https://forum.dynamobim.com/t/select-element-by-host/89942/2 "2023-05-24T09:29:09Z")

</div>

@nedelea.rares ,

what do you mean by host ?

door in wall ?

panell in curtainwall ?

KR

Andreas

---

<div class="post-metadata">

**Author:** ![nedelea.rares](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nedelea.rares](https://forum.dynamobim.com/u/nedelea.rares)\
**Post date:** [May 25, 2023, 8:35am UTC](https://forum.dynamobim.com/t/select-element-by-host/89942/3 "2023-05-25T08:35:38Z")

</div>

Hello @Draxl_Andreas,  
By host I mean structural connection in walls (or parts as required), structural columns or structural framing. This hosted element have host parameter that is used to select them. element like structural rebar or fabric reinforcement could be ignored since it hot have a host parameter. Sometime I want to select all my lifting element from all walls (or parts) to replace them.  
The script at the end is there only to allow Dynamo to highlight the elements.

---

<div class="post-metadata">

**Author:** ![stefan.gokstorp](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@stefan.gokstorp](https://forum.dynamobim.com/u/stefan.gokstorp)\
**Post date:** [May 25, 2023, 2:38pm UTC](https://forum.dynamobim.com/t/select-element-by-host/89942/4 "2023-05-25T14:38:22Z")

</div>

![here](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/2/e29010eacc9af5f83b357cfa1e8628a51bbe408a.png)

get the hosted elements in this case the doors from the walls also keeps the indicies in case you want to insert information back to the object.

should be able to use the same setup for structual element (i dont really work with them so havnt tried it)

---

<div class="post-metadata">

**Author:** ![nedelea.rares](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nedelea.rares](https://forum.dynamobim.com/u/nedelea.rares)\
**Post date:** [May 29, 2023, 12:59pm UTC](https://forum.dynamobim.com/t/select-element-by-host/89942/5 "2023-05-29T12:59:04Z")

</div>

Hello [stefan.gokstorp](https://forum.dynamobim.com/t/select-element-by-host/89942/4),  
Looking at your script I can’t see where you tell it to select only some type of doors. What I’m looking is the ability to select only some types of hosted elements from all walls (or columns or structural framings). Researching a bit my scrip it seams that the problem is somewhere on the selection of element to be selected. It seams that data shapes package have a problem creating a list of multiple elements with same name, it works if I display element id listing every element separately.

---

<div class="post-metadata">

**Author:** ![stefan.gokstorp](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@stefan.gokstorp](https://forum.dynamobim.com/u/stefan.gokstorp)\
**Post date:** [May 29, 2023, 3:32pm UTC](https://forum.dynamobim.com/t/select-element-by-host/89942/6 "2023-05-29T15:32:48Z")

</div>

ah missed that part you would have to add a node with _get parameter value by name_ Code block/string with the Parameter you want to sort with. create one more code block add “x==y” in X you plug in the get parameter node and in Y you plug in the value you want to filter with., create filter by bool and plug in your list with doors in the first box and your list of bools from your Code block "X==Y should do it might have to change lacing
