# Category.ByName vs Element.GetCategory

**URL:** <https://forum.dynamobim.com/t/category-byname-vs-element-getcategory/26034>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [September 17, 2018, 11:48pm UTC](https://forum.dynamobim.com/t/category-byname-vs-element-getcategory/26034 "2018-09-17T23:48:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adi](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@adi](https://forum.dynamobim.com/u/adi)\
**Post date:** [September 17, 2018, 11:48pm UTC](https://forum.dynamobim.com/t/category-byname-vs-element-getcategory/26034/1 "2018-09-17T23:48:28Z")

</div>

Hi,

I am trying to collect all elements in view by category.

I am not sure why the output of Category.ByName is not working but the output of element.GetCategory is working?  
For sheets

 ![referencing%20views](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/e/7e4abda94f215be5f68772501dd92f3f17979871.png)  
For Views  
 ![referencing%20views-2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/e/4e6ad0f37413f0e3dc477e9fe4abf9f2b87f74ef.png)

The collector nodes are from designtech package which I believe is working correctly.  
Not sure why the OOTB nodes with the same outputs are giving different results.

Using  
Revit - 2018.3.1  
Dynamo Core/Revit - 2.0.1.5065

Thanks  
-Aditya
