Access To Material Texture Path

The Building Coder has offered us a clue to finding a Material’s images:

What would one have to do to turn that into a Dynamo node?



I presume it will be implemented soon.
At the moment I have a solution with Python.

#Copyright Alberto Tono

import clr
from Autodesk.Revit.DB import *
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

def toList(obj):
    if hasattr(obj, '__iter__'): return obj
    else: return [obj]
mats = toList(UnwrapElement(IN[0]))

for mat in mats:
	appearanceAssetId = mat.AppearanceAssetId
	assetElem = doc.GetElement(appearanceAssetId)
	getRenderingAsset = assetElem.GetRenderingAsset()
	genericDiffuseProperty = getRenderingAsset.FindByName("generic_diffuse")
	connectedAsset = genericDiffuseProperty.GetSingleConnectedAsset()
	bitmapProperty = connectedAsset["unifiedbitmap_Bitmap"]
	path = bitmapProperty.Value

OUT = path


Appreciate you sharing the code here as well @Alberto_Tono. Even more so considering it was deleted from the Github issues page… :roll_eyes:

1 Like

Sad :frowning: Hope he will implement, at least.

1 Like

Looks useful. Please post the working DYN showing IN[0] .

1 Like

Be sure to place in a .dyf node and set the lacing. Thanks a lot True for the request.
The node took inspiration from several links and materials.


Hello, I’ve created the script as mentioned in @Alberto_Tono’s message. However, I’m being returned only nulls, even for the materials that I know have a texture image at a path.

What might be going wrong?

Hi Alberto, what should I set the lacing to?

Hello Randy, did you end up figuring this out?


You can also use the Material Find Texture Path node.

Thanks, that helps. Does it just ignore materials without texture paths?

Yes, if there is no texture, there is no result.
Maybe I should add a null instead.

Is there an easy way to filter out a material without a texture? I’d like to create a list with a column for material name and a column for texture path.