Family's Materials Name Sort Group

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 ?

Thank you so much.

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

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

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

3 Likes

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]

:ok_hand:

Hi @viktor_kuzev ,

Well done. This is wonderful.
Could you please, Can you add it as text please? :+1: :pray:

Hi again @viktor_kuzev ,

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

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

# 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
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

2 Likes

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 :slight_smile:

Thanks for sharing this solution :pray:

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.