How to set the material parameters "Class" and "Keywords"

Please Help!

I’m new to Dynamo and can’t set the parameters “Class” and “Keywords” from dynamo to revit, all others parameters I’ve manage to change. but this two just don’t get the way to do it.


Thanks,

J

3 Likes

Is it Possible?! Can anyone help please.!!!

Hey Jose,

I was wondering if you have figured this out yet?? This would be an amazing time saver if it worked!!
By chance… have you gotten this to work for the “Description” under the “Appearance” Tab??

These two things are slowing us down from creating mass materials.

Please let me know when you can!

Thanks!

@DAdduci
Can you send a screenshot of what you tried or links to what you found on this topic? Here is one example of the information that could help to solve this issue.

This is the only thread that I have found on this specific topic on “Keywords”… I use RF Tools to update the rest of the Parameter Fields.

I’ll send your link to my team and hopefully we can figure this out.

Thanks for responding!!

1 Like

What Revit version are you in? A lot of material stuff isn’t exposed until 2018.1 .

That’s what I read in the article above… We are usually 3 years behind the latest version of Revit. So we are using “mostly” 2015 and changing to 2016 in the months ahead.

My friend @ramoon.bandeira made this python script.

SET CLASS:

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *

clr.AddReference(‘RevitServices’)
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

def toList(item):
if isinstance(item, list):
return item
else:
return [item]

def SetMaterialClass(material, value):
tx = Transaction(doc, “Set Material Value”)
tx.Start()
material.MaterialClass = value
tx.Commit()
return material

Material = UnwrapElement(toList(IN[0]))
Values = toList(IN[1])

OUT = [SetMaterialClass(mat,v) for mat,v in zip(Material, Values)]

GET CLASS:

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *

def toList(item):
if isinstance(item, list):
return item
else:
return [item]

Material = UnwrapElement(toList(IN[0]))

OUT = [mat.MaterialClass for mat in Material]

GetClasseMaterial.dyf (4.9 KB)
SetClasseMaterial.dyf (7.1 KB)

7 Likes

Thank you so much!!!

Thanks you!!!