How to Control Revit Family via an Excel File?

This question is a continuation from the earlier post, “Do While to process Family Parameters”.

Instead of values entered into a Code Block to control family parameters, I would like to control these variables via an excel file.

I have been able to update the “Mark” value of the family with the following code, but I haven’t been able to work out how to control the (x, y) or (x,y, z) positions.

I also tried using the “CONCATENATE” function in the excel to pull together the x,y and z values but to no avail as well.

Any help here will be appreciated.

Revit version is 2016, Dynamo version is

xLS2CUBE_D.dyn (50.6 KB)
Cubed.rvt (1.2 MB)
Cubes.xlsx (9.8 KB)

1 Like

Thanks Tomasz, for your reply.

But for some reason when I connect the output from the List.GetItem.AtIndex to either Point.ByCoordinates or FamilyInstance.ByCoordinates it doesn’t generate a point list, unlike your illustration.

Essentially what I would like to do is extract the values from the attached Excel spreadsheet to either create new or move existing families in the Revit file.

The Cube shape is immaterial, it could be any family, I have used a cube with parametric values a,b,c for the base, width and height, and an x,y,z position to illustrate the ability to control a generic family.

The link to my previous example was to see how to control the parametric values from within Dynamo, now I would like to extend it to extracting the xyz values from a “database”, in this case an Excel spreadsheet.

Below is the an updated structure of the Dynamo file, the first part is looking at changing the MARK Value of the Cubes which seems to work, the second part is looking at control of the xyz position of the Revit Family, and the third part is looking at the cube parameters a,b and c (base, width and height) from an Excel file.

I looked at two methods to control the point values, ie extracting from the excel columns to create a point list by the individual xyz values, and alternatively by creating a points list in Excel with the “CONCATENATE” function, but neither seemed to work.

Any help on what I’m doing wrong will be greatly appreciated.

New files are attached below.xLS2CUBED_02.dyn (35.8 KB)
Cubes.xls (23.5 KB)
Cubes.rvt (1.2 MB)

Hi, try this one (Dictionary node is from Spring Nodes package)

xLS2CUBED_02.dyn (44.2 KB)

1 Like

Thank you Tomasz for your reply, on viewing your suggestions I realized that perhaps the missing element in my code was using the node String.ToNumber.

So after making some modifications, it now looks like we’re cooking with gas !! The relevant files have been uploaded below.

Anyone using the code will need to make sure they are pointing to the correct location of their .xls file.

If no families are present (as long as the family is part of the revit project file) the the code will generate new families in the position specified in the .xls file, you will need to re-run the code for it to pick up the correct sizing. If you make modifications to the .xls file and re-run the code, the changes will be reflected in the revit model.

Thank you Tomasz for putting me on the right path.

Cubes.xls (27 KB)
xLS2CUBED.dyn (35.7 KB)
CubeD.rvt (1.4 MB)

There’s also a bonus schedule in the uploaded Revit file that produces a cost table based on a cubic metre, but it could also be base on any parameter you wanted.