# Get all objects by parameter

**URL:** <https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596>\
**Category:** Packages\
**Created:** [March 31, 2016, 2:01pm UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596 "2016-03-31T14:01:48Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dennis\_Nelson](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@Dennis\_Nelson](https://forum.dynamobim.com/u/Dennis_Nelson)\
**Post date:** [March 31, 2016, 2:01pm UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/1 "2016-03-31T14:01:48Z")

</div>

So I have a bunch of elements that have a custom parameter assigned. I would to get all those items that have something filled out in those custom parameters. What would be the best way to go about that?

I was thinking that I could grab all the elements in the model and then filter them by if the parameter exists, and then again filter by whether there is something filled out or not. The first problem I ran into was under the revit\>selection there was no select all elements, just all in categories, on levels ect… A work around would be to create node for each category combine the list and then flatten them, but that seems like a more work then should be required. Thanks.

---

<div class="post-metadata">

**Author:** ![Dennis\_Nelson](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@Dennis\_Nelson](https://forum.dynamobim.com/u/Dennis_Nelson)\
**Post date:** [March 31, 2016, 4:31pm UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/2 "2016-03-31T16:31:35Z")

</div>

Actually this is what I came up with. Works Ok.

![2016-03-31 14_57_43-Dynamo](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/2/2be6f700d82b944eb5be10c0c5d7edfa0ead7a6e.png)

---

<div class="post-metadata">

**Author:** ![Vincent\_Olthuis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vincent_olthuis/32/8543_2.png) [@Vincent\_Olthuis](https://forum.dynamobim.com/u/Vincent_Olthuis)\
**Post date:** [April 1, 2016, 1:41am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/3 "2016-04-01T01:41:50Z")

</div>

Hello Dennis,

There is a node called “All Elements In Active View”. Maybe this works for you?

![Printscreen](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/9/9d98bd2877d9cc2975db61f0bd1cc2b7e3427099.png)

Regards, Vincent

---

<div class="post-metadata">

**Author:** ![Martin\_Bijsterbosch](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@Martin\_Bijsterbosch](https://forum.dynamobim.com/u/Martin_Bijsterbosch)\
**Post date:** [April 1, 2016, 9:18am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/4 "2016-04-01T09:18:05Z")

</div>

Hello Dennis, It is possible to get all elements with some python scripting.

**script 1** gets all elements, also non model elements (styles etc).

**script 2** get only model elements. just paste the script into a python node and run to get the elements.

script 1

script 2

Filteren should be doable with standard dynamo nodes.

Regards, Martin

---

<div class="post-metadata">

**Author:** ![Dennis\_Nelson](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@Dennis\_Nelson](https://forum.dynamobim.com/u/Dennis_Nelson)\
**Post date:** [April 1, 2016, 10:12am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/5 "2016-04-01T10:12:21Z")

</div>

Thanks but I need all the elements in the project with that parameter filled out.

---

<div class="post-metadata">

**Author:** ![Dennis\_Nelson](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@Dennis\_Nelson](https://forum.dynamobim.com/u/Dennis_Nelson)\
**Post date:** [April 1, 2016, 10:13am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/6 "2016-04-01T10:13:27Z")

</div>

@Martin Thanks I will give those a shot.

---

<div class="post-metadata">

**Author:** ![Steven](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/steven/32/112504_2.png) [@Steven](https://forum.dynamobim.com/u/Steven)\
**Post date:** [April 1, 2016, 5:41pm UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/7 "2016-04-01T17:41:00Z")

</div>

Since you need every element use a 3D view with everything turned on. I will warn you this may take some time depending on the project size. I have done similar scrips which were garbing every element in view (about 10-15,000 elements) and it took about 10 minutes to run.

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [April 2, 2016, 2:04am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/8 "2016-04-02T02:04:09Z")

</div>

Hi Dennis,

You can also try this:

 ![Untitled](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/d8c4bde3a7f8cfe5ae33a0f5d7d4064492f4bbb2.png)

&nbsp;

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [April 3, 2016, 7:46pm UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/9 "2016-04-03T19:46:12Z")

</div>

There is actually something called Element Parameter Filter in Revit API that can be used just for this purpose. Keep in mind that it’s a slow filter, and running it over all of the elements in a model, will cost you some time.

Here’s how this works:

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/9/988b612d749dd867dd5d9abf3ab4822031450456.png)

&nbsp;

I am selecting a single element in a model to query it for Parameter Names. I then use that parameter and a sample value that a parameter must hold as filter criteria to return all elements that have that parameter and value combination. Now, this is category independent as you can see my filter returns a wall and a desk family since I typed “test” into these two elements Comments parameter.

Here’s Python code:

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

Good luck!

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [April 3, 2016, 8:11pm UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/10 "2016-04-03T20:11:03Z")

</div>

oh and one more thing, please read this: [The Building Coder](http://thebuildingcoder.typepad.com/blog/2010/06/parameter-filter.html)

---

<div class="post-metadata">

**Author:** ![Manel\_Fernandez](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/manel_fernandez/32/9123_2.png) [@Manel\_Fernandez](https://forum.dynamobim.com/u/Manel_Fernandez)\
**Post date:** [April 19, 2016, 9:01am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/11 "2016-04-19T09:01:45Z")

</div>

Hi there,

I’ve used the KULKUL’s python to select all elements in the model. But it select all elements, even those that are not in use. I would like to select only the elements that are placed in the model.

I don’t really know how to do it. I’ve tried to clean the list but it doen’t work.

 ![Captura](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/2/2734d9a7b391403c2af1e96c8f91e2bb9d1b26aa.jpg)

---

<div class="post-metadata">

**Author:** ![Manel\_Fernandez](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/manel_fernandez/32/9123_2.png) [@Manel\_Fernandez](https://forum.dynamobim.com/u/Manel_Fernandez)\
**Post date:** [April 19, 2016, 9:13am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/12 "2016-04-19T09:13:07Z")

</div>

Hi, I’ve changed sth but stil doesnt work.

&nbsp;

 ![Captura](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/e/e8c4bbb30c11203b25a370b2f8aa2df508c34ba0.jpg)

---

<div class="post-metadata">

**Author:** ![Manel\_Fernandez](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/manel_fernandez/32/9123_2.png) [@Manel\_Fernandez](https://forum.dynamobim.com/u/Manel_Fernandez)\
**Post date:** [April 19, 2016, 9:19am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/13 "2016-04-19T09:19:55Z")

</div>

Hi,

Maybe the Category.byname node is not working properly

&nbsp;

 ![Captura](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/3/34bdd078caea08dbbbe28b3f82d0472fb6a90c1f.jpg)

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [April 19, 2016, 12:17pm UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/14 "2016-04-19T12:17:33Z")

</div>

Hi Manel,

You need to add Prefix “\_OST”. Read this topic.

[http://dynamobim.org/forums/topic/category-byname-node-doesnt-work/](http://dynamobim.org/forums/topic/category-byname-node-doesnt-work/)

---

<div class="post-metadata">

**Author:** ![Manel\_Fernandez](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/manel_fernandez/32/9123_2.png) [@Manel\_Fernandez](https://forum.dynamobim.com/u/Manel_Fernandez)\
**Post date:** [April 20, 2016, 12:45am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/15 "2016-04-20T00:45:21Z")

</div>

Thks KULKUL,

In case that someone read this dicussion, just one little thing, the prefix is “OST\_”, but it doen’t work for all the categories.

 ![Captura](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/d03d70670c35e3c5dd12d68ef3c732c286814855.jpg)

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [April 20, 2016, 2:21am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/16 "2016-04-20T02:21:58Z")

</div>

Hi Manel,

Which Dynamo version your using? Try to install latest Dynamo version 1.0. It works for me. Below there are some options how to get category. Good Luck!

 ![Untitled](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/7/76178cb6e4471ee021f690b7e6a1e039ce632a5c.png)

&nbsp;

---

<div class="post-metadata">

**Author:** ![Manel\_Fernandez](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/manel_fernandez/32/9123_2.png) [@Manel\_Fernandez](https://forum.dynamobim.com/u/Manel_Fernandez)\
**Post date:** [April 20, 2016, 2:51am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/17 "2016-04-20T02:51:38Z")

</div>

Hi KULKUL,

I’m using 0.9.2 version because I’ve downloaded from this forum. I thought it was the latest one.

Do you know where I could find the latest one?

Thks

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [April 20, 2016, 3:24am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/18 "2016-04-20T03:24:09Z")

</div>

At the below you will find.

 ![Untitled](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/3/3616a3e598a4ea32a65464c35221c41c1e10c0e4.png)

---

<div class="post-metadata">

**Author:** ![Manel\_Fernandez](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/manel_fernandez/32/9123_2.png) [@Manel\_Fernandez](https://forum.dynamobim.com/u/Manel_Fernandez)\
**Post date:** [April 20, 2016, 4:13am UTC](https://forum.dynamobim.com/t/get-all-objects-by-parameter/3596/19 "2016-04-20T04:13:59Z")

</div>

Yes, you were right. I was the dynamo version. Now it’s working that node.

&nbsp;

Thks
