# Setting all material parameters to \<By Category\>

**URL:** <https://forum.dynamobim.com/t/setting-all-material-parameters-to-by-category/23304>\
**Category:** Revit\
**Created:** [July 2, 2018, 9:13pm UTC](https://forum.dynamobim.com/t/setting-all-material-parameters-to-by-category/23304 "2018-07-02T21:13:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ckress](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@ckress](https://forum.dynamobim.com/u/ckress)\
**Post date:** [July 2, 2018, 9:14pm UTC](https://forum.dynamobim.com/t/setting-all-material-parameters-to-by-category/23304/1 "2018-07-02T21:14:00Z")

</div>

I am attempting to use a script to get rid of all of the previously set materials in a project and replace them to be set to When I do this I get an error message in my final step that says “Warning: Parameter.SetValue operation failed.  
The call is ambiguous between the following methods or properties: ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, Revit.Elements.Element)’ and ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, string)’” If anyone has any advice on how to fix this please let me know!

 ![Revit%20Dynamo%20Help](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/e/5e71e0250e20d524c1c64a8c6d5d9450dd8afa58.JPG)

---

<div class="post-metadata">

**Author:** ![NurlanAdsk](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@NurlanAdsk](https://forum.dynamobim.com/u/NurlanAdsk)\
**Post date:** [September 9, 2020, 4:07am UTC](https://forum.dynamobim.com/t/setting-all-material-parameters-to-by-category/23304/2 "2020-09-09T04:07:59Z")

</div>

I have a similar question. How to set a material parameter “By Category”?

---

<div class="post-metadata">

**Author:** ![stephen.varner](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@stephen.varner](https://forum.dynamobim.com/u/stephen.varner)\
**Post date:** [February 21, 2022, 2:23pm UTC](https://forum.dynamobim.com/t/setting-all-material-parameters-to-by-category/23304/3 "2022-02-21T14:23:40Z")

</div>

I’m also trying to use Dynamo to set material parameters to .

It seems that trying to set a material to By Category doesn’t work because By Category is not technically a material; It’s the wrong data type. Even using Element.Get on another material that’s already set to By Category returns a string…

Would be cool if Dynamo or the API had a way to set a parameter to By Category even though it doesn’t fit the data type…

---

<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:** [February 21, 2022, 2:27pm UTC](https://forum.dynamobim.com/t/setting-all-material-parameters-to-by-category/23304/4 "2022-02-21T14:27:41Z")

</div>

I am not sure, but try setting the value to -1 and not null. The Revit API doesn’t do nulls, it does ElementId.InvalidId or -1 when there is no value for that parameter type.

---

<div class="post-metadata">

**Author:** ![akiraaaaa](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@akiraaaaa](https://forum.dynamobim.com/u/akiraaaaa)\
**Post date:** [May 19, 2023, 10:02am UTC](https://forum.dynamobim.com/t/setting-all-material-parameters-to-by-category/23304/5 "2023-05-19T10:02:41Z")

</div>

You can set a material to By Category to use this node (in clockwork)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/a/4a815a21b488ef8446d7b8eb0c93ee0313529ef3.png)
