# How get OST (Built-In Name) of element

**URL:** <https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657>\
**Category:** Lists-Logic\
**Tags:** python\
**Created:** [December 23, 2017, 10:45am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657 "2017-12-23T10:45:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![til.shviger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/til.shviger/32/36048_2.png) [@til.shviger](https://forum.dynamobim.com/u/til.shviger)\
**Post date:** [December 23, 2017, 10:45am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/1 "2017-12-23T10:45:51Z")

</div>

How get OST category name of element?

for examle we are have selected pipe in Revit to IN[0]

ostcategory=_GetOST_( IN[0] ) ??

And we get this:  
OUT=ostcategory

> > > > **OST\_PipeCurves**

---

<div class="post-metadata">

**Author:** ![Claus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/claus/32/37199_2.png) [@Claus](https://forum.dynamobim.com/u/Claus)\
**Post date:** [December 23, 2017, 10:53am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/2 "2017-12-23T10:53:56Z")

</div>

[Revit Category Guide.xlsx](https://forum.dynamobim.com/uploads/short-url/5VRS4RQFUUPWlpZIKTjYV4Q4iiL.xlsx) (368.6 KB)

I use this spreadsheet which lists the OST Revit Categories.

---

<div class="post-metadata">

**Author:** ![til.shviger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/til.shviger/32/36048_2.png) [@til.shviger](https://forum.dynamobim.com/u/til.shviger)\
**Post date:** [December 23, 2017, 10:59am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/3 "2017-12-23T10:59:54Z")

</div>

@Claus thanks, but im want to get Built-In Name (AsString) of element in Dynamo )

---

<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:** [December 23, 2017, 11:39am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/4 "2017-12-23T11:39:44Z")

</div>

Hi @til.shviger

Are you looking for this?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/c/0c4b754cc59127dba42d7235eadcf45113977f44.jpg)

---

<div class="post-metadata">

**Author:** ![til.shviger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/til.shviger/32/36048_2.png) [@til.shviger](https://forum.dynamobim.com/u/til.shviger)\
**Post date:** [December 23, 2017, 11:41am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/5 "2017-12-23T11:41:31Z")

</div>

@Kulkul  
YES!  
can you show what is inside the script?

---

<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:** [December 23, 2017, 11:46am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/6 "2017-12-23T11:46:28Z")

</div>

> [@til.shviger](#):
>
> can you show what is inside the script?

Sure!

```
import clr, System
clr.AddReference("RevitNodes")
import Revit
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
 
catname = IN[0]
bic = System.Enum.GetValues(BuiltInCategory) 
cats, bics = [], []
for i in bic:
    try:
        cat = Revit.Elements.Category.ById(ElementId(i).IntegerValue)
        cats.append(cat)
        bics.append(i)
    except:
        pass
 
for i, b in zip(cats, bics):
    if catname == str(i): 
        ost = b 
 
OUT = ost

```

---

<div class="post-metadata">

**Author:** ![til.shviger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/til.shviger/32/36048_2.png) [@til.shviger](https://forum.dynamobim.com/u/til.shviger)\
**Post date:** [December 23, 2017, 11:53am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/7 "2017-12-23T11:53:07Z")

</div>

@Kulkul

everything works perfect! 👌

Thank you!

---

<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:** [December 23, 2017, 11:56am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/8 "2017-12-23T11:56:13Z")

</div>

@til.shviger You’re welcome!

Merry Christmas 🎄 and happy holidays 🙂 . Cheers!

---

<div class="post-metadata">

**Author:** ![til.shviger](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/til.shviger/32/36048_2.png) [@til.shviger](https://forum.dynamobim.com/u/til.shviger)\
**Post date:** [December 23, 2017, 12:03pm UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/9 "2017-12-23T12:03:24Z")

</div>

> [@Kulkul](#):
>
> Merry Christmas

Merry Christmas ! 🎇 I Wish you happiness and success at work in the New Year 🤗

---

<div class="post-metadata">

**Author:** ![Tim\_Halvorson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/tim_halvorson/32/24593_2.png) [@Tim\_Halvorson](https://forum.dynamobim.com/u/Tim_Halvorson)\
**Post date:** [April 6, 2018, 5:26pm UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/10 "2018-04-06T17:26:42Z")

</div>

I tried this just now and got the following error:

> ```
> Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed. 
> Traceback (most recent call last):
> File "<string>", line 25, in <module>
> NameError: name 'ost' is not defined
> 
> ```

so basically the variable to get the resulting category is not working for me. The end game for me is to get a handle on Revit Links and extract information from linked RVT documents. Found the category:

> Autodesk.Revit.DB.BuiltInCategory.OST\_RvtLinks

but not sure how to access the elements with this built-in category.  
Thoughts?

---

<div class="post-metadata">

**Author:** ![dbrokaw](https://avatars.discourse-cdn.com/v4/letter/d/5f8ce5/32.png) [@dbrokaw](https://forum.dynamobim.com/u/dbrokaw)\
**Post date:** [April 3, 2019, 12:41pm UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/11 "2019-04-03T12:41:44Z")

</div>

If you are like me and must know the details to remember something here is a nugget for you.

Built-in Category OST Prefix - What does it stand for

Almost all the built-in category enum values come equipped with an “OST\_” prefix.  
OST\_ it is short for “O” bject “ST” yle.

Credit: Jeremy Tammik + arnostlobel

---

<div class="post-metadata">

**Author:** ![peter.knight](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/peter.knight/32/44592_2.png) [@peter.knight](https://forum.dynamobim.com/u/peter.knight)\
**Post date:** [May 23, 2019, 12:17am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/12 "2019-05-23T00:17:49Z")

</div>

Hi @Kulkul,  
I’m trying to understand your script line by line (novice), and can’t work out the ById() part. Where does it come from? I can’t seem to find it in the API documentation, or in Dynamo (although most of that path is there).  
I can make it work, but I don’t understand it at all! Any help most appreciated!

---

<div class="post-metadata">

**Author:** ![chuongmep](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/chuongmep/32/197537_2.png) [@chuongmep](https://forum.dynamobim.com/u/chuongmep)\
**Post date:** [March 6, 2020, 7:11am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/13 "2020-03-06T07:11:32Z")

</div>

Please convert Catname ToString

> if catname.**ToString()** == i:

---

<div class="post-metadata">

**Author:** ![AlexanderBerg](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alexanderberg/32/82944_2.png) [@AlexanderBerg](https://forum.dynamobim.com/u/AlexanderBerg)\
**Post date:** [March 7, 2020, 6:37pm UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/14 "2020-03-07T18:37:39Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/6/d6231316d6a9dd00b1b9f0a2ec471d0427dd55b6.png)

```
# by Alexander Berg | 2020-03-07 | Automated Design Solutions

import clr, System
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

OUT = [i for i in System.Enum.GetValues(BuiltInCategory) if str(i) == "OST_"+IN[0]]
```

---

<div class="post-metadata">

**Author:** ![hosamelshazly92](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosamelshazly92/32/91877_2.png) [@hosamelshazly92](https://forum.dynamobim.com/u/hosamelshazly92)\
**Post date:** [March 28, 2020, 2:42pm UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/15 "2020-03-28T14:42:39Z")

</div>

This guide is so helpful, thanks for sharing

---

<div class="post-metadata">

**Author:** ![hosamelshazly92](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosamelshazly92/32/91877_2.png) [@hosamelshazly92](https://forum.dynamobim.com/u/hosamelshazly92)\
**Post date:** [March 28, 2020, 2:44pm UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/16 "2020-03-28T14:44:56Z")

</div>

Does OST refers to object style type?

---

<div class="post-metadata">

**Author:** ![AH\_Yafim](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@AH\_Yafim](https://forum.dynamobim.com/u/AH_Yafim)\
**Post date:** [July 14, 2020, 9:50am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/17 "2020-07-14T09:50:27Z")

</div>

Hi,  
Do you know what’s the correct **Python** syntax for the following **C#** line?  
I’m having trouble matching the Id value to the string OST\_Rooms.

```
if ( (BuiltInCategory)element.Category.Id.IntegerValue == BuiltInCategory.OST_Rooms)
{
...
}

```

Thanks

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [July 15, 2020, 4:52am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/19 "2020-07-15T04:52:22Z")

</div>

> [@AH\_Yafim](#):
>
> `if ( (BuiltInCategory)element.Category.Id.IntegerValue == BuiltInCategory.OST_Rooms)`

hello you can try this  
`if element.Category.Id.IntegerValue.ToString() == BuiltInCategory.OST_Rooms.value__.ToString() :`  
OR better  
`if element.Category.Id == ElementId(BuiltInCategory.OST_Rooms) :`

---

<div class="post-metadata">

**Author:** ![AH\_Yafim](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@AH\_Yafim](https://forum.dynamobim.com/u/AH_Yafim)\
**Post date:** [July 15, 2020, 7:44am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/20 "2020-07-15T07:44:21Z")

</div>

Perfect, thanks!  
Can you explain a bit where the `.value__` parameter comes from?

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [July 15, 2020, 10:32am UTC](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657/21 "2020-07-15T10:32:00Z")

</div>

> [@AH\_Yafim](#):
>
> rfect, thanks!  
> Can you explain a bit where the `.value__` parameter comes from?

`value__` is a property (getter) to get the constant value (integer) of the enumeration, another way is to get the enumeration type and then convert it

 ![explain value__ from bic](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/e/ae0878d7e323f38cb3c0cfc5e8e40018c607a38a.png)

[Next page](https://forum.dynamobim.com/t/how-get-ost-built-in-name-of-element/17657.md?page=2)
