Write values from an excel file into a family doc, as parameter values

I have an small excel table example. The original is bigger. There are rows with different configurations and columns with parameters. These parameters are already created in a Revit family (with non existing values). Now I like to choose a row in Dynamo and transfer these values from excel to the instance parameters in the Revit family.

I have prepared the lists. Her can u see the result in the green groups:

The whole script looks like this:

Maybe I do something wrong with the “Set Active Family Parameter By Name” Node [data shapes package]. My attempt was to set the datatype of the values, because only the text parameter are working.

How can I change the data type of the values, depending on the data types extracted from the revit family parameters? Is it necessary?

According to the Parameter type, I need to convert the units. E.g. an length parameter needs a different conversion as an area parameter. Any idea how to choose automated the correct conversion?

Excel table:
konfigurationen.xlsx (9.7 KB)

Script:
konfiguration.dyn (55.6 KB)test_family.rfa (332 KB)

Hi @Thomas_Vogt1

Remove Double Prime(") Symbol from your code block and multiply by 3.28 using “*” node to convert m to ft.

ty Kulkul,
the code block is just an simple example. I have Parameter with length, text, volts, area etc and not all should be multiplied by 3.2808. Because of that, I have extracted the Parameter types from the family and according to the parameter types I need different conversions.

@Thomas_Vogt1 In that case use Formula or IF node to convert the values by specific types.

looks like I have solved it. Just the Length and Volume value is not exact correct because of the unit conversion (34 is now 33.965):

maybe someone has a easier solution to convert the display units to revit internal units?

Hello, maybe with Clockwork nodes (DisplayUnit.ToInternalUnit and InternalUnit.ToDisplayUnit)

1 Like

The use of DisplayUnit.ToInternalUnit is not without problems with a list of all types of parameters. You need to remove text and integers first and lacing to longest =) But the conversion of the units is more precise than my first manual calculation method

Solution:

https://1drv.ms/i/s!Ar9xxoyu3-Zhhtpr2fRBl5J8RDaNgw

1 Like