Select and place families through a list

Hello all,

I’m experiencing a challenge which I can not find the answer to in my dynamoscript.

I have an excel file which has coordinates and the height of the light pole which needs to be placed at those coordinates. I have changed the family name to the corresponding height in the excel file (so the light pole family which has to be 4m high is called 4, as in the excel file).

My idea was to select using the familytype.byname with as input the index with the height from the excel. This way the family type is selected by the height from the corresponding coordinates. However when I do so I get the error: “Warning: One or more of the input types are not matching. Couldn’t find a version of ByName that takes arguments of type (__array)”

If I use a string with one of the heights it will work. So my guess is my method doesn’t accept lists.

Does anyone have a solution as to how I can script this in dynamo to achieve my desired workflow? Looking forward to your answers. Thanks in advance.



Hi @Peter.Schakel,

What hapens when you put a “String from Object” node between the “List.GetItemAtIndex” and “FamilyType.ByName” node ?
I think it handles Lists fine, but it has to be a list of strings (not integers).

Kind regards,

Thank you, it then solves the problem! Only strange thing is that if I select string from objects it automatically adds .000000 to the number. So I have to manually remove the .000000 and then it works!

Hi Peter,

Good to hear this works for you.
Strange side effect indeed… but it’s only the end result that counts.

Kind regards,