There’s a Clockwork node which returns the area/volume of materials (think it’s called Element.Materials?), and you can choose whether or not to include paint materials as well. That should return what you’re looking for?
@Organon I am getting the following whenever I am running the workflow:
Warning:
IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 31, in
File “”, line 21, in PaintFace
TypeError: Multiple targets could match: GetElement(Reference), GetElement(str), GetElement(ElementId)
Can you help out please?
Hi @Organon could you please share PaintElements.dyn file ? I know you shared the Python script for painting surfaces but it seems to give an error “unexpected indent” which I don’t know where is coming from.
I had to change the material to thousands of “structural element” ( in reality Direct Shape geometry, for this reason was impossible to apply any material to the instance or to the type)… PAINT was the only way, and thanks to your script I managed to do it automatically!
at the end of the day, it crashes many times since the elements were too much.
Since the elements are an import from Tekla -> then IFC from a client -> than Revit, they are BrepDirect Shapes, so the material is following the Object style of the Category (Structural Framing or columns) instead of the Type/Instance Material Parameter.
I definately believe it is . I don’t know if there’s any nodes around that does the job though. Otherwise you’d have to implement this method with a bit of python.
import clr
#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
#Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
#Reference the active Document and application
doc = DocumentManager.Instance.CurrentDBDocument
elems = UnwrapElement(IN[0])
gOpts = Options()
TransactionManager.Instance.EnsureInTransaction(doc)
for i in elems:
geom = i.get_Geometry(gOpts)
for j in geom:
face = j.Faces
for f in face:
if doc.IsPainted(i.Id, f):
doc.RemovePaint(i.Id, f)
TransactionManager.Instance.TransactionTaskDone()
OUT = 0
I found the solution for this issue. You can use version of René’s Python Script and you just adjust this line to : elemRef = surf.Tags.LookupTag(“RevitFaceReference”) instead of elemRef = surf.Tags.LookupTag(‘RevitFaceReference’)