I got an error say that expected element got family Instance but from my understanding family instance can directly link to element right?


What I trying to do is set a value into my family shared parameter through dynamo however, after I get all value I need, I used .SetParameterValueByName and got this error. This is my python scripts

My input is simple
IN[0] is from select model elements (Column selected)
IN[1] is counted number of vertical rebar in selected column
IN[2] is size of vertical rebar in selected column

Then I try to input all of these data into specific cell in family


Then got expected element got family instance error

Try

Element.SetParameterByName()

Sorry I miss type i used .SetParameterByName() I tried both Element and FamilyInstance

I would do it a little differently.

ele[i].LookupParameter("Rebar Amount").Set(rebarno)

Haha sorry for late reply I actually got it the problem isn’t the code itself. The problem actually come from how I set up my family parameters when I create. I overlook such a trivial details

1 Like