# Family's Materials Name Sort Group

**URL:** <https://forum.dynamobim.com/t/familys-materials-name-sort-group/75130>\
**Category:** Revit\
**Created:** [April 4, 2022, 8:57am UTC](https://forum.dynamobim.com/t/familys-materials-name-sort-group/75130 "2022-04-04T08:57:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![DynaGirlBIM](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dynagirlbim/32/98488_2.png) [@DynaGirlBIM](https://forum.dynamobim.com/u/DynaGirlBIM)\
**Post date:** [April 4, 2022, 8:57am UTC](https://forum.dynamobim.com/t/familys-materials-name-sort-group/75130/1 "2022-04-04T08:57:25Z")

</div>

Hi everyone,

I am wondering something. I created basic box family. And then I did paint some surfaces with paint tool in Revit.  
I want to ask this. Can I grouped paint area and non paint area ? or How to group material name this areas ?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/2/0249f8734887289971249a91d78ae87693679687.png)

Thank you so much.

---

<div class="post-metadata">

**Author:** ![Elie.Trad](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/elie.trad/32/110373_2.png) [@Elie.Trad](https://forum.dynamobim.com/u/Elie.Trad)\
**Post date:** [April 4, 2022, 12:09pm UTC](https://forum.dynamobim.com/t/familys-materials-name-sort-group/75130/2 "2022-04-04T12:09:32Z")

</div>

@DynaGirlBIM you can get that within the family through parameters and formulas, then schedule your families in Revit project

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [April 4, 2022, 1:04pm UTC](https://forum.dynamobim.com/t/familys-materials-name-sort-group/75130/4 "2022-04-04T13:04:44Z")

</div>

If you’re comfortable with Python you might do something like that:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/5/1524c9b8cef4b649a4d2053ab7bc3a1903db1e3e.png)

I’m not aware of an existing node that could give you the different materials applied to faces of an element.

---

<div class="post-metadata">

**Author:** ![DynaGirlBIM](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dynagirlbim/32/98488_2.png) [@DynaGirlBIM](https://forum.dynamobim.com/u/DynaGirlBIM)\
**Post date:** [April 5, 2022, 6:29am UTC](https://forum.dynamobim.com/t/familys-materials-name-sort-group/75130/5 "2022-04-05T06:29:17Z")

</div>

Hi tradeli, you are right. but it is very complexly. Maybe I think there must be an easier way?

So, Thanks for advice. [quote=“Elie.Trad, post:2, topic:75130, full:true”]  
@DynaGirlBIM you can get that within the family through parameters and formulas, then schedule your families in Revit project  
[/quote]

> [@Elie.Trad](#):
>
> @DynaGirlBIM you can get that within the family through parameters and formulas, then schedule your families in Revit project

👌

---

<div class="post-metadata">

**Author:** ![DynaGirlBIM](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dynagirlbim/32/98488_2.png) [@DynaGirlBIM](https://forum.dynamobim.com/u/DynaGirlBIM)\
**Post date:** [April 5, 2022, 6:32am UTC](https://forum.dynamobim.com/t/familys-materials-name-sort-group/75130/6 "2022-04-05T06:32:55Z")

</div>

Hi @viktor_kuzev ,

Well done. This is wonderful.  
Could you please, Can you add it as text please? 👍 🙏

---

<div class="post-metadata">

**Author:** ![DynaGirlBIM](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dynagirlbim/32/98488_2.png) [@DynaGirlBIM](https://forum.dynamobim.com/u/DynaGirlBIM)\
**Post date:** [April 5, 2022, 7:30am UTC](https://forum.dynamobim.com/t/familys-materials-name-sort-group/75130/7 "2022-04-05T07:30:09Z")

</div>

Hi again @viktor_kuzev ,

I took a error message. Where is the problem ? I did not find it.

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

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [April 5, 2022, 8:30am UTC](https://forum.dynamobim.com/t/familys-materials-name-sort-group/75130/8 "2022-04-05T08:30:10Z")

</div>

I had to rewrite it since I didn’t save it yesterday.  
And I also tried it in Revit 2022

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

```auto
# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
# The inputs to this node will be stored as a list in the IN variables.
opt = Options()
materials = []
faces = []
geometry = UnwrapElement(IN[0]).get_Geometry(opt)
for obj in geometry:
	instanceGeometry = obj.GetInstanceGeometry()
	for solid in instanceGeometry:
		if solid.Volume>0:
			for face in solid.Faces:
				materials.append(doc.GetElement(face.MaterialElementId))
				faces.append(face.Convert()[0])
# Place your code below this line

# Assign your output to the OUT variable.
OUT = faces, materials

```

This is the exact code I used.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/d/4df8b2682a2f0a1efd4631ebb626aed04a98f159.png)  
And Dynamo version.

I suspect the problem at your side is with the Python installation, but I don’t really know. Try this code, try restarting the program and if it doesn’t work we’d need to summon the experts

---

<div class="post-metadata">

**Author:** ![DynaGirlBIM](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dynagirlbim/32/98488_2.png) [@DynaGirlBIM](https://forum.dynamobim.com/u/DynaGirlBIM)\
**Post date:** [April 5, 2022, 8:39am UTC](https://forum.dynamobim.com/t/familys-materials-name-sort-group/75130/9 "2022-04-05T08:39:57Z")

</div>

Thank you so much @viktor_kuzev ,

Now, this script runned. No problem for me. But I do not undertand. I write same this too. It did not work. But it is runnign interesting 🙂

Thanks for sharing this solution 🙏

---

<div class="post-metadata">

**Author:** ![viktor\_kuzev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/viktor_kuzev/32/48254_2.png) [@viktor\_kuzev](https://forum.dynamobim.com/u/viktor_kuzev)\
**Post date:** [April 5, 2022, 8:52am UTC](https://forum.dynamobim.com/t/familys-materials-name-sort-group/75130/10 "2022-04-05T08:52:03Z")

</div>

Try running the two through a tool that checks for differences between two documents.  
But I suspect something else went wrong the first time with the way Dynamo executed the code itself.
