Replace material with other

Is it possible to replace material with other material wherever it was assigned?

There’s nothing that would prevent you from doing this. You’d just have to find every instance of that material, which is a lot of heavy lifting. It might be easier to modify the existing material to match the one you want.

This company I’m currently employed at had some weird practice to have separate material for each wall or floor layer width. They didn’t know how to extract material thickness in material take offs. Now I have to clean the template, and other projects, reassign materials, purge material duplicates etc…

Can you please give me an example on how can I replace “Material 1” in “Wall 1” with “Material 2”?

Material is set with an element (Id). It works the same as setting any parameter value, you would just pass the material element you want to use. If you’re only looking at wall and floor types this shouldn’t be too bad. But if you have to do this for “all” elements then it could be a lot of work finding all the material parameters for all element types.

Just in case anyone else ends up looking for a solution to this post as I was. I’ve just written a script that finds & replaces materials within compound layer objects.

This could of course be expanded to serve any object but that would require a fair bit of extra code and for now, I only need compound components :slight_smile: .

Enjoy

04_MaterialRenaming.dyn (22.1 KB)

5 Likes

Awesome

1 Like