# Set Material of Category to Null

**URL:** https://forum.dynamobim.com/t/set-material-of-category-to-null/64763
**Category:** Uncategorized
**Tags:** revit
**Created:** [June 4, 2021, 2:05pm UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763 "2021-06-04T14:05:49Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![norbert\_graeser](https://avatars.discourse-cdn.com/v4/letter/n/c37758/32.png) [@norbert\_graeser](https://forum.dynamobim.com/u/norbert_graeser)
#### Post date: [June 4, 2021, 2:05pm UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/1 "2021-06-04T14:05:49Z")

</div>

I try to set the material of a Revit Category to Null / Empty. Used the “Set SubCategory Properties” from GeniusLoci, what works well for assigning materials. But how to “deassign”? Inside Revit I can use the Button in the lower left. But how to do this with Dynamo???

THX

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/3/e3afdf918dc5d70f6d9e208556f0de2d42e788ce.png)

---

<div class="post-metadata">

### Author: ![Hyunu\_Kim](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hyunu_kim/32/100239_2.png) [@Hyunu\_Kim](https://forum.dynamobim.com/u/Hyunu_Kim)
#### Post date: [June 4, 2021, 2:18pm UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/2 "2021-06-04T14:18:38Z")

</div>

Have u tried with blank? ("")

---

<div class="post-metadata">

### Author: ![norbert\_graeser](https://avatars.discourse-cdn.com/v4/letter/n/c37758/32.png) [@norbert\_graeser](https://forum.dynamobim.com/u/norbert_graeser)
#### Post date: [June 4, 2021, 10:30pm UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/3 "2021-06-04T22:30:14Z")

</div>

Yes, I did. But that doesn’t work. Seems to a problem with the type.

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/a/daf4d3a1c7206feacea4acc3b43283b81ff7ae4c.png)

---

<div class="post-metadata">

### Author: ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)
#### Post date: [June 4, 2021, 11:12pm UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/4 "2021-06-04T23:12:32Z")

</div>

Have you tried feeding it a `null`?

---

<div class="post-metadata">

### Author: ![norbert\_graeser](https://avatars.discourse-cdn.com/v4/letter/n/c37758/32.png) [@norbert\_graeser](https://forum.dynamobim.com/u/norbert_graeser)
#### Post date: [June 4, 2021, 11:57pm UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/5 "2021-06-04T23:57:37Z")

</div>

Yes - but didn’t work.

---

<div class="post-metadata">

### Author: ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)
#### Post date: [June 5, 2021, 6:24am UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/6 "2021-06-05T06:24:02Z")

</div>

Hello @norbert_graeser …how about this ?

 ![test](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/f/3f5dea49a5efbc5826ac1e1067e507b26280e34f.png)

---

<div class="post-metadata">

### Author: ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)
#### Post date: [June 5, 2021, 8:29am UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/7 "2021-06-05T08:29:40Z")

</div>

PS…the way i have done it in the image above, has this issue it delete the material from the library…

I havent find out yet, how to just empty the subcategori material, set to no material

---

<div class="post-metadata">

### Author: ![Marcel\_Rijsmus](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marcel_rijsmus/32/8539_2.png) [@Marcel\_Rijsmus](https://forum.dynamobim.com/u/Marcel_Rijsmus)
#### Post date: [June 5, 2021, 12:28pm UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/8 "2021-06-05T12:28:20Z")

</div>

Maybe this has some clue

> [@Set phase demolished to None](https://forum.dynamobim.com/t/set-phase-demolished-to-none/6807):
>
> Is it possible set the demolished phase of elements to “None” by Dynamo? [image] Our background: We use a different program for out cost estimations which needs an IFC-file to work with. Because of the limitations in the Revit IFC-Export we need to set up a separate demolition phase, which is obviously not ideal, but no way around that, if we want to distinguish the demolished elements in the calculation program. To make the phase-management in Revit easier, I want to set the demolished phase…

---

<div class="post-metadata">

### Author: ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)
#### Post date: [June 5, 2021, 4:34pm UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/9 "2021-06-05T16:34:36Z")

</div>

Ah! It’s an element ID. The old -1 trick if I am not mistaken. Not sure how to produce that without Dynamo so editing the Python Konrad posted in that topic is the likely best path forward.

---

<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: [June 5, 2021, 7:27pm UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/10 "2021-06-05T19:27:33Z")

</div>

Hello,  
set Material to null (None) works perfectly (no need parameter)

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

```auto
import clr
import sys
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS

#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB

#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

toList = lambda x : x if hasattr(x, ' __iter__') else [x]
#Preparing input from dynamo to revit
cats = toList(UnwrapElement(IN[0]))

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

for cat in cats:
	cat.Material = None

TransactionManager.Instance.TransactionTaskDone()

OUT = cats

```

from Revit API doc

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/f/9fbed0619c40a48afcd2b8cef2de33faca895ff0.png)

---

<div class="post-metadata">

### Author: ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)
#### Post date: [June 5, 2021, 8:45pm UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/11 "2021-06-05T20:45:53Z")

</div>

You can also use

`Mat = ElementId.InvalidElemtId`

[https://www.revitapidocs.com/2015/08ae8886-6ab3-3ef5-d2e0-0da2ffa7bd2c.htm](https://www.revitapidocs.com/2015/08ae8886-6ab3-3ef5-d2e0-0da2ffa7bd2c.htm)

---

<div class="post-metadata">

### Author: ![norbert\_graeser](https://avatars.discourse-cdn.com/v4/letter/n/c37758/32.png) [@norbert\_graeser](https://forum.dynamobim.com/u/norbert_graeser)
#### Post date: [June 7, 2021, 2:55pm UTC](https://forum.dynamobim.com/t/set-material-of-category-to-null/64763/12 "2021-06-07T14:55:43Z")

</div>

Thank you for your help!

```auto
"cat.Material = None" is what do the job in a perfect way.
```
