Controlling Family Types Using a String not Variable

Im trying to produce a very simple demonstration in order to raise awareness in my organisation of Dynamo and automation.

I have a simple model with a line which has the properties of UB-Universal Beam ‘family’. I have a simple formula in Excel which determines the beam ‘type’ that i want to use. I can get revit/dynamo/excel to talk to each other such that the spreadsheet reads the beam length and then determines the correct beam type to use. I can get dynamo to read the ‘type’ of beam that i want to use as a string. BUT - i cant then get dynamo to update the beam type in my revit model - the only nodes that i can find to update the ‘family’ ‘type’ in revit need the ‘type’ as a variable rather than a string. Can anybody offer any help?


Without being able to see the error message is it difficult. I am neither sure that the way you are setting the ‘family and type’ is correct, I have never tried it that way. Could you please provide the graph and the test model?

Sorry - i should have included more info.

The problem is that Element.SetParameterByName, as well as other nodes such as FamilyInstance.SetType seem to need a variable as an input (in this case the ‘value’ input) and not a string.

I would attach the file but the forum wont let me as a ‘new user’.

try see these posts

Sound odd that new users cant upload files, it is exactly newcomers that needs to be able to upload files!?

@daniel.peel you can try this solution. Make sure that your ‘Family and Type’ parameter are set to string, then you have to enable the readasString as True.

Thank you both for your help but i am still stuck with the basic problem that the Element.SetParameterbyName node needs a variable and not a string as an input for ‘value’. None of the referenced posts quite address this.

@rexfrancojesse - how do i make sure that my ‘Family and Type’ parameter is set to string? This seems to be what i am missing but i cant figure out how to do this?

Apologies - Ive done some more digging and followed further back some of the threads suggested and found the answer (or at least an answer).

If i use the string read from my excel spreadsheet as input to a FamilyType.ByName node then this outputs the Family Type. I can then use this as input to the FamilyInstance.SetType node.

Many thanks for your help - i am amazed at the responses on this forum - really useful - its a fantastic resource.