# Assign Material to all Object Styles

**URL:** https://forum.dynamobim.com/t/assign-material-to-all-object-styles/53504
**Category:** Revit
**Tags:** python
**Created:** [July 29, 2020, 6:16am UTC](https://forum.dynamobim.com/t/assign-material-to-all-object-styles/53504 "2020-07-29T06:16:43Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Andrej.Licanin](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@Andrej.Licanin](https://forum.dynamobim.com/u/Andrej.Licanin)
#### Post date: [April 5, 2022, 6:31pm UTC](https://forum.dynamobim.com/t/assign-material-to-all-object-styles/53504/4 "2022-04-05T18:31:36Z")

</div>

You do not set it on an Object Style object, you set it on a category. These objects just read that property.  
I had a problem where i needed to remove all materials from object style (for IFC export to work correctly) and this is the code snippet.

```auto
cats=list(doc.Settings.Categories)
exit=[]
TransactionManager.Instance.EnsureInTransaction(doc)
for i in cats:
	catType=i.CategoryType
	isModelCat=catType== CategoryType.Model
	if isModelCat:
		if i.Material != None:
			i.Material=None
			exit.append(i)
TransactionManager.Instance.TransactionTaskDone()

```

also see this post

> [@Set Material of Category to Null](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/5):
>
> Yes - but didn’t work.

---

_[View the full topic](https://forum.dynamobim.com/t/assign-material-to-all-object-styles/53504)._
