Material Asset Names



Is it possible to modify Material Asset Names through Dynamo? I’m trying to get materials in order and have managed to export, import & rename the materials but now I’d like to fix the material assets and am getting nowhere. The watch node will read the Asset Names but I can’t get them into any kind of list. It is also putting up an error stating: Warning: Asked to convert non-convertible types.

New Material Library export to excel and import to project?
List Appearance Assets for Material


This is indeed a little tricky because these elements don’t have a Parameter called name, but instead its a property. Here’s how you can handle it.

Here’s the code that’s inside of Python:

# Copyright(c) 2016, Konrad K Sobon
# @arch_laboratory,

# Import Element wrapper extension methods
import clr
import Revit

# Import DocumentManager and TransactionManager
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

# Import RevitAPI
import Autodesk
from Autodesk.Revit.DB import *

import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'

#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN

def ProcessList(_func, _list):
    return map( lambda x: ProcessList(_func, x) if type(x)==list else _func(x), _list )

def ProcessParallelLists(_func, *lists):
	return map( lambda *xs: ProcessParallelLists(_func, *xs) if all(type(x) is list for x in xs) else _func(*xs), *lists )

def SetName(e, name):
	e.Name = name
	return e

def Unwrap(item):
	return UnwrapElement(item)

if isinstance(IN[0], list):
	elements = ProcessList(Unwrap, IN[0])
	elements = [Unwrap(IN[0])]

names = IN[1]

	errorReport = None
	output = ProcessParallelLists(SetName, elements, names)
	# if error accurs anywhere in the process catch it
	import traceback
	errorReport = traceback.format_exc()

#Assign your output to the OUT variable
if errorReport == None:
	OUT = output
	OUT = errorReport

Basically we created a method that will override a Name property on any element.


Python Nodes Basics


Will the Python script facilitate renaming after exporting to Excel for processing?


That’s a different question. Please start a new thread.

Thank you,


Hi Chad_Clay

“Will the Python script facilitate renaming after exporting to Excel for processing?”

Have you investigated this further?


I have not :flushed:

I do believe that part of the problem(s) I’ve had with Asset names has to do with the fact that Material Asset names can’t include " or / in them e.g. 5/8" GWB (probably some other symbols too), but other than beating my head against a wall over that nuance I haven’t had a chance to get back to this.


No worries, I will let you know if get anywhere with this problem.

Cheers Thanks again.


I got it to export the Material with its associated Asset. Now I’m working on how to rename both in Excel & import back. Would I need to also get Element Ids to correlate changes, or is there a reference yawl can point me to?


Hi @cftrevizo,

Have you had anyluck on renaming the material assets?


I was about to get back to wrapping up my Dynamo Scripts for Material Mgmt with this last piece being the Asset Mgmt in the coming weeks. Attached is where I left off. Both scripts (Export/Import that you can separate) are in the file, but Frozen. Let me know if you run into any hitches.
Export Material Assets_v2.dyn (79.5 KB)