I am working with an excel file and a generic annotation. I am trying to push ~570 rows of data into the family and output ~570 family types with a unique number and the proper description text (from the excel file). Currently, I am stumbling on if I need to use the “data.exportexcel” node. If anyone could help me understand the importing / exporting excel logic (when to use) that would be very helpful.
I am also stumbling on what to do with the columns. - should I separate column A and column B to create family types? Would I lose the link between the number and the description?
You shouldn’t need the exportexcel node, as export means you want to take something out of Revit, but in this case you want to bring something in, so ImportExcel is what you want.
As for the columns, you should separate them so it is easier to change the parameters of. The best way to do this with how the data is in the ImportExcel node is to use a List.Transpose to get them in their own list. They will stay in the same order so you know that the value in the 0 spot of number is for the same type as the value in the 0 spot of description.
From there you can use them for the set parameter value node.
@kennyb6 - Thanks for the response. I was watching this video about exporting and importing excel data and revit data - so I was using that logic as a basis for the script. I was under the impression that there was a link that had to be established to move data back and forth. https://www.youtube.com/watch?v=XlKnNW9KqSU As you can see from my script, I was close to purging the “exportexcel” node from the script - so Thanks again for answering that question.
I will take a try at isolating each column of the excel document.
You seem to have the right direction on how to solve your problem.
The reason you graph doesn´t work is on the “basic” of working with nodes. The Dynamo Primer is a great source to look up on how to get a specific item in a list or a sub-list. Have it open while working with Dynamo.
As for the main problem:
It will be easier to create new types for the family within a project rather than family editor. In case you want to stick to the family editor: Find a package that includes nodes that work within a family editor.
The data you get from Excel can be transposed. this way you´ll have the columns as sub-lists.
A solution within the project could look like this:
Thanks @Kibar for the advice and help! You and all the other Dynamo users on this great forum are a great resource! Again much appreciated, I will post with an update on the progress!
Thank you for the help thus far, I appreciate it greatly! I was able to get a little bit further, and figured out how to push numeric data to create a numeric family type. (green square)
However, I am missing the logic to associate the text field to that numeric list. (red square) You can see the nodes that i have at the bottom of the screenshot were my thoughts for next steps.
the error in the second “Element.SetParameterByName” - Dereferencing a non-pointer
The FamilyType.Duplicate node takes a FamilyType and a Name as input.Out comes a new FamilyType with the new name. Look carefully into how Nodes are built: what you give as Input and what you get as Output.
At the /W ElementType.Duplicate you´re placing a string (text) as elementType and already duplicated Family Types as names. This is probably the reason for the error in Element.SetParameterByName, but should be the last thing to solve for you.
First, try to get the Family Types duplicated with the right names and look into setting parameters later.
Make different Inputs, see what happens, and keep on looking into the Dynamo Primer and search in this forum.
I was able to get the script to work, finally! I had to reorder the Element.SetParameterByName node for both “column 1” and “column 2” in the excel spreadsheet with a Passthrough node. It now assigns the number first then the description second to a generic annotation family.