Create a New Materials from Excel Data


#1

Hi All,

I am starting to use dynamo and I would like to create a materials from a list in Excel and update also the Description and Class. Can anyone help me with this. Thanks in advance.


#2

That’s quite a lot to do, although I think very doable.
What I’d advice you to do is to dive into controlling familiy via parameters, unless you’re already pretty skilled with that.
Once you got that down it’s time to write a bit of code in Dynamo to read from excel and write to Revit.
Reading from excel files, manipulating the data and writing to Revit are worth a topic on themselves. To give you an idea what “size” you’re going to be dealing with:


This is the code I’m using to read from excel, manipulate data, set parameter data and create new family types.
I’m thinking the clockwork package might be a necessity for you, that has nodes aimed at creating and altering materials. You might want to focus on getting the hand of using those nodes before starting reading files from excel.


#3

AT the moment only managed to read the excel files and get the data I need but not sure how to write the new material from the list I have. Thanks.

image


#4

Well that’s a good first step.
Do you have the Clockwork package installed?
That’s got a lot of nodes focused on changing materials.


#5

Thanks Paul. Yes I have the clockwork package and got this under materials.
image


#6

You can create new Materials by using the Material.Duplicate node and then give it its properties with the Element.SetMaterialParameterByCategory. If I’m honest I don’t have much experience with creating and changing materials with this, only family types.


#7

Thanks PauLtus.


#8

Did you manage to get it working in those 24 days?


#9

Hi Paul,

Sorry for the late response. Yes I manage to get it working. Thanks.


#10

Could you share your solution here? It could help others to solve similar issues.


#11

I’d love to see your solution to this problem as I am trying to accomplish something similar!


#12

@wma_sfenton - best to start a new thread, as since Hassan hasn’t shared his work so far and any solution provided would run the risk of derailing his topic. When you create yours be sure to provide what you’ve trying to accomplish, what you’re stuck with, and relevant source files (a nearly empty .rvt, the .dyn of your current graph and the xlsx file).


#13

I have done :slight_smile:


#14

Hi all,

Sorry for the late reply. Been busy lately. If have done similar script as wma_sfenton. Thanks.


#15

Then please mark his comment as his solution (and maybe leave a like for the comments you found to be helpful).


#16

Could you either share that code or posting a better picture please?
(I’m referring to the second post of the 2nd of March)
Thanks!


#17

I didn’t share that picture to give a graph to be used. It’s use is very specific. I just wanted to give an indication of what size you’d be dealing with.

Quite interesting I used to find that to be a large graph.


#18

I would like to kindly ask you could you share (even in private) your dynamo file, I need to create new material from an excel file. I have taken this dynamo project
example
as example but I have still difficult to have access in both physical and thermal section


#19

My graph isn’t creating new materials from an excel file, it’s creating new family types from an excel file. I sent the image to give a sense of how big a Dynamo graph might become.