# Changing wall materials

**URL:** <https://forum.dynamobim.com/t/changing-wall-materials/47969>\
**Category:** Revit\
**Created:** [March 11, 2020, 4:02pm UTC](https://forum.dynamobim.com/t/changing-wall-materials/47969 "2020-03-11T16:02:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodrigo.bezerra](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rodrigo.bezerra/32/99963_2.png) [@rodrigo.bezerra](https://forum.dynamobim.com/u/rodrigo.bezerra)\
**Post date:** [March 11, 2020, 4:02pm UTC](https://forum.dynamobim.com/t/changing-wall-materials/47969/1 "2020-03-11T16:02:41Z")

</div>

Hi,

I have hundreds of wall types. Most of them need a material change because the paint manufacturer (hence, the paint color) is other now.

I’ve already configured the new materials, and I figured this: first I retrieve all the walls materials, then filter the ones with matching marks, then when I get ex. material 307 manufacturer X I replace for material 307 manufacturer Y.

However I could even get values for Mark and Manufacturer parameters, as the pic shows. The error is “Warning: Internal error, please report: Dereferencing a non-pointer.”

I appreciate any help

 ![substituiMateriaisDentroParedes](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/1/718f6d7dee38743d4cd9d6618ec941a42afd009b.png)

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [March 11, 2020, 4:26pm UTC](https://forum.dynamobim.com/t/changing-wall-materials/47969/2 "2020-03-11T16:26:19Z")

</div>

Hi @rodrigo.bezerra

Use List.Clean node before GetParameterByName. That error indicates there are nulls in your list.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/1/51ad19f34564ecb0107d02943e8bd7211d4d629f.png)

---

<div class="post-metadata">

**Author:** ![rodrigo.bezerra](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rodrigo.bezerra/32/99963_2.png) [@rodrigo.bezerra](https://forum.dynamobim.com/u/rodrigo.bezerra)\
**Post date:** [March 11, 2020, 6:36pm UTC](https://forum.dynamobim.com/t/changing-wall-materials/47969/3 "2020-03-11T18:36:14Z")

</div>

It worked, but using another node, so I don’t loose the indexes.

What I figured now is that I don’t really know how to:

1. knowing which materials are from manufacturer X, list which has marks starting with a given character;
2. return to the primary list and get item at indexes

 ![substituiMateriaisDentroParedes](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/e/be4711796a73fda81a082f315a7bc4bf6f0535ed.png)

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [March 11, 2020, 9:43pm UTC](https://forum.dynamobim.com/t/changing-wall-materials/47969/4 "2020-03-11T21:43:37Z")

</div>

Not sure if this is what you are looking for, but this script will replace all materials that match the name with another material in all layers of a wall.

[Materials - Change Compound Type Materials.dyn](https://forum.dynamobim.com/uploads/short-url/xNwEw07vSecVwZGXhWYXEqhu40I.dyn) (35.1 KB)

---

<div class="post-metadata">

**Author:** ![rodrigo.bezerra](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rodrigo.bezerra/32/99963_2.png) [@rodrigo.bezerra](https://forum.dynamobim.com/u/rodrigo.bezerra)\
**Post date:** [March 11, 2020, 9:56pm UTC](https://forum.dynamobim.com/t/changing-wall-materials/47969/5 "2020-03-11T21:56:27Z")

</div>

If it’s not the solution, might lead me to it. I’ll check and get back tomorrow. Thank you!

---

<div class="post-metadata">

**Author:** ![rodrigo.bezerra](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rodrigo.bezerra/32/99963_2.png) [@rodrigo.bezerra](https://forum.dynamobim.com/u/rodrigo.bezerra)\
**Post date:** [March 12, 2020, 2:02pm UTC](https://forum.dynamobim.com/t/changing-wall-materials/47969/6 "2020-03-12T14:02:16Z")

</div>

@SeanP just a follow-up: I tried the dyn you shared, but there are a few packages missing in my PC. I think there’s something with my Dynamo version also… I’m in 1.3.4 because 2.X do not load any packages (not sure why). Some custom nodes aren’t working.

Unfortunately I do not have the time to explore Dynamo right now as I’m behind my schedule. I’ll explore it a little more later.

Thank you so much!

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [March 12, 2020, 10:26pm UTC](https://forum.dynamobim.com/t/changing-wall-materials/47969/7 "2020-03-12T22:26:57Z")

</div>

The script I provided is written in 1.3.4. The script uses Clockwork and Data-Shapes.

Here is an image of the graph as well if it helps you build what you need.

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/3/830ffec4e02295a95ee8fd77b07727ef25a03f4f.png)

I also removed a couple nodes that were internal tracking and information nodes to hopefully make it work a little easier for you.

[Materials - Change Compound Type Materials.dyn](https://forum.dynamobim.com/uploads/short-url/wM31Vq0dOs5nT9f3WGjQ34rrVie.dyn) (35.6 KB)

---

<div class="post-metadata">

**Author:** ![KevinD](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@KevinD](https://forum.dynamobim.com/u/KevinD)\
**Post date:** [April 6, 2023, 8:07pm UTC](https://forum.dynamobim.com/t/changing-wall-materials/47969/8 "2023-04-06T20:07:42Z")

</div>

Hey Sean - Is this able to be expanded?? would love to pick your brain on possibly setting something like this up, but to update materials for several categories at once (floors, ceilings, walls, doors, frames.)

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [April 6, 2023, 8:44pm UTC](https://forum.dynamobim.com/t/changing-wall-materials/47969/9 "2023-04-06T20:44:37Z")

</div>

There may be ways to extend it yes, but keep in mind that as it is now, it is only for compound (system) families like walls, floors, and roofs. Singular (family instance) things like Doors or frames would be different.
