# Error when setting object Text Style

**URL:** <https://forum.dynamobim.com/t/error-when-setting-object-text-style/101071>\
**Category:** Civil 3D\
**Tags:** python, dynamo, civil3d\
**Created:** [May 16, 2024, 3:51pm UTC](https://forum.dynamobim.com/t/error-when-setting-object-text-style/101071 "2024-05-16T15:51:31Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Anton\_Huizinga](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/anton_huizinga/32/155377_2.png) [@Anton\_Huizinga](https://forum.dynamobim.com/u/Anton_Huizinga)\
**Post date:** [May 17, 2024, 6:23am UTC](https://forum.dynamobim.com/t/error-when-setting-object-text-style/101071/9 "2024-05-17T06:23:11Z")

</div>

It might be the index approach that does not work in Python, in this line:

text\_styles[style]

Maybe there is a GetTextStyle() method as replacement?

> [@"TypeError" When Trying to Get Block Table Record of Model Space](https://forum.dynamobim.com/t/typeerror-when-trying-to-get-block-table-record-of-model-space/77729/2):
>
> This is a goofy thing with how Python.NET handles virtual indexers. You can use this instead: bt.get\_Item(BlockTableRecord.ModelSpace) or bt.get\_Item("\*Model\_Space")

---

_[View the full topic](https://forum.dynamobim.com/t/error-when-setting-object-text-style/101071)._
