# Material Asset Names

**URL:** <https://forum.dynamobim.com/t/material-asset-names/4824>\
**Category:** Developers\
**Tags:** revit, archi-lab\
**Created:** [July 1, 2016, 5:24pm UTC](https://forum.dynamobim.com/t/material-asset-names/4824 "2016-07-01T17:24:24Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chad\_Clary](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/chad_clary/32/10510_2.png) [@Chad\_Clary](https://forum.dynamobim.com/u/Chad_Clary)\
**Post date:** [July 1, 2016, 5:24pm UTC](https://forum.dynamobim.com/t/material-asset-names/4824/1 "2016-07-01T17:24:24Z")

</div>

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.

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

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [July 1, 2016, 6:09pm UTC](https://forum.dynamobim.com/t/material-asset-names/4824/2 "2016-07-01T18:09:35Z")

</div>

@Chad_Clary,

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.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/c/cde6e7de255ed64797e9da28d5b375f7ff6bb5e8.png)

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

```auto
# Copyright(c) 2016, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net

# Import Element wrapper extension methods
import clr
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

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

#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])
else:
	elements = [Unwrap(IN[0])]

names = IN[1]

try:
	errorReport = None
	TransactionManager.Instance.EnsureInTransaction(doc)
	output = ProcessParallelLists(SetName, elements, names)
	TransactionManager.Instance.TransactionTaskDone()
except:
	# 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
else:
	OUT = errorReport

```

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

Cheers!

---

<div class="post-metadata">

**Author:** ![Chad\_Clary](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/chad_clary/32/10510_2.png) [@Chad\_Clary](https://forum.dynamobim.com/u/Chad_Clary)\
**Post date:** [July 1, 2016, 6:59pm UTC](https://forum.dynamobim.com/t/material-asset-names/4824/3 "2016-07-01T18:59:23Z")

</div>

Thanks!

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

---

<div class="post-metadata">

**Author:** ![Konrad\_K\_Sobon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/konrad_k_sobon/32/8838_2.png) [@Konrad\_K\_Sobon](https://forum.dynamobim.com/u/Konrad_K_Sobon)\
**Post date:** [July 1, 2016, 8:52pm UTC](https://forum.dynamobim.com/t/material-asset-names/4824/4 "2016-07-01T20:52:38Z")

</div>

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

Thank you,

---

<div class="post-metadata">

**Author:** ![Batman86](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Batman86](https://forum.dynamobim.com/u/Batman86)\
**Post date:** [April 17, 2017, 7:50pm UTC](https://forum.dynamobim.com/t/material-asset-names/4824/5 "2017-04-17T19:50:40Z")

</div>

Hi Chad\_Clay

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

Have you investigated this further?

---

<div class="post-metadata">

**Author:** ![Chad\_Clary](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/chad_clary/32/10510_2.png) [@Chad\_Clary](https://forum.dynamobim.com/u/Chad_Clary)\
**Post date:** [April 17, 2017, 8:36pm UTC](https://forum.dynamobim.com/t/material-asset-names/4824/6 "2017-04-17T20:36:16Z")

</div>

I have not 😳

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.

---

<div class="post-metadata">

**Author:** ![Batman86](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Batman86](https://forum.dynamobim.com/u/Batman86)\
**Post date:** [April 17, 2017, 9:09pm UTC](https://forum.dynamobim.com/t/material-asset-names/4824/7 "2017-04-17T21:09:15Z")

</div>

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

Cheers Thanks again.

---

<div class="post-metadata">

**Author:** ![cftrevizo](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@cftrevizo](https://forum.dynamobim.com/u/cftrevizo)\
**Post date:** [November 15, 2017, 9:33pm UTC](https://forum.dynamobim.com/t/material-asset-names/4824/8 "2017-11-15T21:33:14Z")

</div>

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?

 ![Dyna-Materials](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/3/c3292de8026003d8ec4a9eb6874ac2ac090f4a63.PNG)

---

<div class="post-metadata">

**Author:** ![neoscenic](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@neoscenic](https://forum.dynamobim.com/u/neoscenic)\
**Post date:** [October 26, 2018, 3:28am UTC](https://forum.dynamobim.com/t/material-asset-names/4824/9 "2018-10-26T03:28:50Z")

</div>

Hi @cftrevizo,

Have you had anyluck on renaming the material assets?

---

<div class="post-metadata">

**Author:** ![cftrevizo](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@cftrevizo](https://forum.dynamobim.com/u/cftrevizo)\
**Post date:** [October 26, 2018, 4:15pm UTC](https://forum.dynamobim.com/t/material-asset-names/4824/10 "2018-10-26T16:15:21Z")

</div>

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](https://forum.dynamobim.com/uploads/short-url/aRegClSplHsu5wnLEz7EvzpQBro.dyn) (79.5 KB)

---

<div class="post-metadata">

**Author:** ![aksel.alvarez](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@aksel.alvarez](https://forum.dynamobim.com/u/aksel.alvarez)\
**Post date:** [April 13, 2022, 5:30pm UTC](https://forum.dynamobim.com/t/material-asset-names/4824/11 "2022-04-13T17:30:37Z")

</div>

Hi there! I’m trying to do something similar but need some help that you folks may have found on your way.

I’m creating a library of materials out of an Excel Spreadsheet. In this spreadsheet I have all the configuration that I need to create my materials: graphics settings (foreground color, pattern, etc) all the identity data and so on, but I would like to create the materials with an Appereance Asset from the Library that already exists in Revit.

With my script I can create new Appereance Assets via duplicate, as you can see in the picture, but I would like to read the existing Appereance Assets from one of the Asset Browser and, kind of, “set parameter by name” to assign the correct one to each material.

Does anyone has experience with this or has a suggestion? I haven’t figured out how can I call nor query the Asset Browser.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/f/cf50cf932443b43f79dc8cbace8d1f66ef18b260.jpeg)

---

<div class="post-metadata">

**Author:** ![angadtiwari](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@angadtiwari](https://forum.dynamobim.com/u/angadtiwari)\
**Post date:** [July 13, 2022, 7:03am UTC](https://forum.dynamobim.com/t/material-asset-names/4824/12 "2022-07-13T07:03:29Z")

</div>

Well so you can definitely read the document assets now. I guess we have a Genius Loci Code here which can collect material assets with there names:

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

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

But then you are limited to work only with the appearance asset loaded in the document. I am thinking if we could access the standard appearance asset library of Revit. and apply them to the materials . it really is the last piece of the puzzle.
