In Material Browser, the way of changing parameters

Hello All!!

I am trying to change the parameter such as Name, Description, and Class in Material Browser. But I couldn’t figure out how to do that!!
Is it possible to change these parameters using nodes or python script in Dynamo?

Hi @sang87yun,

You can change the values of the parameters like this :


Python script to set the material class:

#Alban de Chasteigner 2020
import clr
# Import RevitAPI Classes
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import Material
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

materials = UnwrapElement(IN[0]) if isinstance(IN[0],list) else [UnwrapElement(IN[0])]
names = IN[1] if isinstance(IN[1],list) else [IN[1]]

TransactionManager.Instance.EnsureInTransaction(doc)
for mat, name in zip(materials,names):
	mat.MaterialClass = name
TransactionManager.Instance.TransactionTaskDone()

OUT = materials

I really appreciate it. Your solution was really helpful for me to solve the problem!!

I need your help in solving the problem.
I just followed your solution, but some errors came out and I failed to run the program.
If you don’t mind, could you tell me my problem? I attached my file here.

The error is strange because we don’t have a line 37 in the python code.
Can you try with this .dyn file ?
material properties.dyn (18.3 KB)