Set Value_ Material Parameter

Is possible to set a value from a Material Parameter in a Family?

Hi @Raul.Galdran

?

1 Like

Perfect! I was trying a node i made and set the rest of parameters despite the Material. Iā€™ll check that one, i think i have it.

Thanks a lot for your time and solution.

Hi again @Kulkul I just tried that solution.

It says Check Parameter Type.

The only difference between your solution and mine is the Element.ID node. Could be that?, or did you modify the Set Active Famiy Parameter By Name?

Thanks again.

Yes use that. BTW do you have ā€œMaterialā€ Parameter in Family properties?

Use that it means ā€œyour nodeā€ or the one iā€™m using already?

By the way, i checked the exception and says:

Exception: The storage type of family parameter is not a double type or integer type.
Parameter name: familyParameter

My node Element.Id returns an integer. Should return an Element ID for make the Set Active Family Parameter By Name work?

  • The Material prameters is a Type Parameter, is in Family Properties, would be any different if would be an instance parameter ?

Yes!

@Raul.Galdran Follow exactly my instructions on the gif.

Excuse me, i found the node Element.ID, thought didnā€™t have it in my library. Now it worked!

Thanks for your time.

Hello @Kulkul! Please repost your solution.

Hey,

The ā€˜All Elements of Typeā€™ didnā€™t work for me, not sure whatā€™s changedā€¦

Hereā€™s my versionā€¦

Hope that helps,

Mark

import clr
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes") 
import Revit 
clr.ImportExtensions(Revit.GeometryConversion) 
clr.ImportExtensions(Revit.Elements) 
from Revit.Elements import *

doc = DocumentManager.Instance.CurrentDBDocument

fec = FilteredElementCollector(doc).OfClass(Autodesk.Revit.DB.Material)

materials = []

for material in fec:
    materials.append([material.Name, material.Id])


OUT = materials