Changing material texture file path with issues

I have changed all the material names and then changed the texture file path with “Genius Loci_Material Change Texture Path”.
Some of the new texture file can be catched but with wrong orders, some just missing.
Is it possible to I tell Dynamo to pick up the new texture file names orderly?

Like this:

Thanks!

Hey,

Perhaps post your .Dyn with a screen grab? I’m sure it is fixable :slight_smile:

Cheers,

Mark

1 Like

Hi @sdzbrian,

Use the Find Texture Path and the String.Replace nodes.


Change Texture Path.dyn (11.6 KB)

4 Likes

Thank you so much!!!

Hi, @Alban_de_Chasteigner in the first place great nodes! I have no trouble reassigning the textures when I browse the jpg files. However, when I try to use a path I constructed on my own, I get only a null. It be great if you could point me to a solution. Thanks in advance.

Hi,

Welcome to the Dynamo forum.
It’s difficult to help you without seeing the full graph and a sample Revit file.
Can you add the .dyn and a small .rvt files ? (with a web hosting platform like google drive, Dropbox, … if you can’t post these files on the forum for the moment)

Thanks for the warm welcome! :slightly_smiling_face: Turns out my paths were not valid. But once I got past this. It seems I have a trouble with the lacing, may be.

Could you provide your new script? I have the same issue, but receiving nulls while juste replacing portions of the string. I noticed my Lists are not flat. Using Revit 2021 with newest Dynamo. Any ideas?

Hi,

Welcome to the Dynamo Forum.
Please show a picture of your graph to get relevant answers.
How to get help on the Dynamo forum

1 Like


It somehow only works for the first few materials :frowning: Maybe it’s because sometimes we have 3, sometimes only one texture loaded depending on the material?

I also noticed that using the older version of Genius Loci from june 2020 the lists are flattened, while in the newer 2020 versions the are nested.

Also, it always does something weird to my filepaths:
ReplacementIssue

Can you show the previews under the nodes ?

I think so.

The Change Texture Path node only changes the “main” image in the appearance asset.
image

You need to remove the other secondary textures of the nested list and fllatten the list after the Find Texture Path node.

I’ve noticed this before, but I don’t have a conclusive explanation yet.

The API for materials is cumbersome. :roll_eyes:

1 Like

Thank you so much for you quick reply!
So it is not possible to change for example the Bump or Cutout textures? The main issue while I am dealing with this at all is the following:
We have a adsklib with materials for renderings, each with multiple PBR Textures and they are lying on a NAS. Due to home office we would like to be able to move the directory to the laptops, but Revit does not offer a solution for updating file paths and is not able to work with realtive filepaths for textures …

Also: Adding the texture directory in the revit options under rendering is not working.
I cant think of clicking ~100 textures and assigning each texture anew.

I just checked and this is currently not possible with the Change Texture Path node. This is most likely possible with the API though.

If you have knowledge of Python you can improve the Change Texture Path node and share your improvements.

1 Like

Sadly I don’t have any knowledge. Obvisouly I got to dive into it, to implement the features that Autodesk will probably provide in 10+ years…

Thank you for your ambitions to help!

1 Like