# Automate Choosing material image for IFC in Revit

**URL:** <https://forum.dynamobim.com/t/automate-choosing-material-image-for-ifc-in-revit/9728>\
**Category:** Revit\
**Tags:** revit\
**Created:** [February 17, 2017, 6:47pm UTC](https://forum.dynamobim.com/t/automate-choosing-material-image-for-ifc-in-revit/9728 "2017-02-17T18:47:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BIM4CLT](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@BIM4CLT](https://forum.dynamobim.com/u/BIM4CLT)\
**Post date:** [February 17, 2017, 6:47pm UTC](https://forum.dynamobim.com/t/automate-choosing-material-image-for-ifc-in-revit/9728/1 "2017-02-17T18:47:38Z")

</div>

Hi wonderful community,

New to Dynamo, always wanted to get into it and see huge potential with it and our workflows.

But I’m currently looking at one of the most repetitive and boring tasks I’ve ever been asked to do in Revit.

Essentially I have an IFC of a manufactured CLT building imported into Revit, approx 1450 elements.

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

1st issue is the import has converted each element as an **In-Place object**.  
2nd issue is each element has its own unique material, 1450 of them.

My task is to convert the Grey IFC to look like timber. The only way I’ve found to do that in Revit is to manually change each element \> material appearance \> input path to image folder, one by one…and while this is only 1450 x 3 clicks away, once it is done once it will be asked to be done again in the future. (I know 3Ds Max would probably be the right place to do this, but they want section cuts etc in the renders too).

I get how some of the nodes etc work in Dynamo but I think a bit of help with this script will help me put the pieces together.

Thank you all!!

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [February 17, 2017, 8:46pm UTC](https://forum.dynamobim.com/t/automate-choosing-material-image-for-ifc-in-revit/9728/2 "2017-02-17T20:46:11Z")

</div>

Can you verify that the IFC parameter really drives the material? I would rather imagine that the in-place elements have a type parameter that could just be None or Default at the moment, which could be easy to fix at once. Anyway, if I am mistaken, here are some tips to get started:

- You will first need to collect all the elements that you want to change. There are different methods to select elements: _Categories_ / _All Elements of Category_ could select all walls, and this page could give other clues:  
[http://dynamoprimer.com/en/08\_Dynamo-for-Revit/8-2\_Selecting.html](http://dynamoprimer.com/en/08_Dynamo-for-Revit/8-2_Selecting.html)
- If the material parameter is indeed a type parameter, this thread could help:  
[Set Type Parameter](https://forum.dynamobim.com/t/set-type-parameter/9660)
- If the material to change is structural, see also this:  
[http://dynamobim.org/forums/topic/problems-with-structural-material-parameter/](http://dynamobim.org/forums/topic/problems-with-structural-material-parameter/)

---

<div class="post-metadata">

**Author:** ![BIM4CLT](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@BIM4CLT](https://forum.dynamobim.com/u/BIM4CLT)\
**Post date:** [February 17, 2017, 8:59pm UTC](https://forum.dynamobim.com/t/automate-choosing-material-image-for-ifc-in-revit/9728/3 "2017-02-17T20:59:27Z")

</div>

Hi Yna!

Right you are, if I edit the in-place element they each have a type parameter

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/6/f6c60939bf085080f6f640ead0cd3fa1cb7ed7a5.png)

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [February 17, 2017, 9:13pm UTC](https://forum.dynamobim.com/t/automate-choosing-material-image-for-ifc-in-revit/9728/4 "2017-02-17T21:13:24Z")

</div>

Then it could simply work this way:

- Select all walls with the nodes _Categories_ / _All Elements of Category_
- Set their type parameter with _SetParameterByName(TypeOrInstance)_ from Rhythm (use _Material.ByName_ to select the material value)

---

<div class="post-metadata">

**Author:** ![BIM4CLT](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@BIM4CLT](https://forum.dynamobim.com/u/BIM4CLT)\
**Post date:** [February 17, 2017, 9:26pm UTC](https://forum.dynamobim.com/t/automate-choosing-material-image-for-ifc-in-revit/9728/5 "2017-02-17T21:26:57Z")

</div>

Sorry Yna I don’t think I’ve quite followed you,

"

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/a/fa498bf5442accc6cc1c7c141cbdd36e22c39713.png)

Warning: Element.SetParameterByName operation failed.  
No parameter found by that name.

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [February 17, 2017, 9:32pm UTC](https://forum.dynamobim.com/t/automate-choosing-material-image-for-ifc-in-revit/9728/6 "2017-02-17T21:32:09Z")

</div>

The parameter name is “Material” and you will need a _Material.ByName_ node to select the material element (it has to be inserted between the code block containing “CLT Yoker” and the input for the value):

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/5/d51b99e9757d6cbc5aa22502e21243f445a9b329.JPG)

---

<div class="post-metadata">

**Author:** ![BIM4CLT](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@BIM4CLT](https://forum.dynamobim.com/u/BIM4CLT)\
**Post date:** [February 17, 2017, 10:03pm UTC](https://forum.dynamobim.com/t/automate-choosing-material-image-for-ifc-in-revit/9728/7 "2017-02-17T22:03:15Z")

</div>

Ok, Rythm installed, Dynamo updated, I’ve got this built…

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

But nothing really happened, and yes I’ve hit Run 🙂

Thank you so much if you manage to crack this!!!1

---

<div class="post-metadata">

**Author:** ![BIM4CLT](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@BIM4CLT](https://forum.dynamobim.com/u/BIM4CLT)\
**Post date:** [February 17, 2017, 10:06pm UTC](https://forum.dynamobim.com/t/automate-choosing-material-image-for-ifc-in-revit/9728/8 "2017-02-17T22:06:31Z")

</div>

Tried this too,

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

but no change to the model

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [February 18, 2017, 5:28pm UTC](https://forum.dynamobim.com/t/automate-choosing-material-image-for-ifc-in-revit/9728/9 "2017-02-18T17:28:37Z")

</div>

In this case, it could be that the material of these elements is simply set in the **Object Styles** dialog in Revit. Did you also try to change the Walls Material there?
