I cant seem to figure out why my Material.ByName node output is null. The Element.SetParameterByName is also null. I tried matching the code block value to the excel sheet columns but still did not work.
Please help! Attached is a dropbox link to download the files! Thank You!
I have something similar for space planning and remember running into a similar problem. The material creation needs to be accessed via a python node as it requires the api to create a new material for each element/department.
Attached is the sample dynamo nodes for the materials, hope it helps…
def ToDynamoObject(revitObject, isRevitOwned=False): # isRevitOwned should be False if Dynamo script created the object.
return revitObject.ToDSType(isRevitOwned)
Another thing I noticed in the Mass Family is that I had to create and associate a parameter for the Fill Color material. It wasn’t there in the original download? Just double check to ensure you have the material parameter in the family associated with a parameter accessible in the project…this may be part of the problem?
I guess the issue I am running into is the following. In Rhino-Grasshopper it is that you can set geometry from the actual 3D modeling program into the scripting plugin, and then manipulated it. Once you’re done, you can “bake” it back into the 3D modeling program and work with it there again.
I am sort of lost on what to do with the “generic box” created in the Revit family file. Also once the script is working, does dynamo have a “bake” option or can you start manipulating your shaped instantly in Revit?
okay so I figured out the Select Elements node lets you select the forms in the Revit into Dyanmo…but I still don’t know how to associate it with the fill color material
It is a matter of gathering all of the elements in a list, and then once they are in a list they need to be assigned the corresponding material. It is all about the list management.
As for the Materials, the trick is to ensure that the value being fed into the Set parameter node is a material…that is where the Material.ByName node comes into play.
There is no “bake” function in Dynamo, so the script just does it’s thing…you can also set it into manual mode to gain a bit more control.
Hope this helps.
Okay So I got most of it down. Still having a few issues with the Python Scripting. Can you take a look at what I have done, please? the Dynamo script added to the dropbox link above!