Element.SetParameterByName in Project & in nested family

Hi there,

I have on order of self-baring platework, with all the metadata of these families engraved in the geometry, for easy manufacturing.

As text-family’s only accept text-parameter, I have a script that turns the instancename of the family into text, and assigns it to the family.

Unfortunately, only the families in the project get their parameter updated.

Families nested within another families don’t, although everything is shared…

Any thoughts on how to update all the families?

Kind regards,

Willem

You find this script attached…
geveldragers naam geven 09.dyn (19.1 KB)

What is the error message?

As a hint, and not doing it for you: There is multiple versions, but this one from Clockwork has always worked for me:

1 Like

Hi Jacob,

“No parameter found by that name”.

Kind regards,

Willem

Hi Jostein,

I already founded it in another thread, and it sounds promising.

Unfortunately, the conclusion was it is not possible , unless you dive deep into pyton.

If I look at the numbers, I see 43 family’s, containing 39 shared nested family’s.

Pfff…, this is confusing, because the family & the nested family are filtered on he same word in their name. Let me change the name of the big family, & delete all non-shared families within it.


Now we are looking at 16 families, 3 within the projects, the others in the big family. The green families have their sub (sub)families shared.
Run…

Now I have 16 familes “geveldrager” I want to adress.
Only the those in the project get their parameter overwritten.

I can see 25 subcomponents within my green families “geveldrager”.
So I guess I have to move the .Sub components node upstream, and split the workflow?

Now I have the 13 nested families singled out as sub-components.

But Dynamo crashes when I try to set their parameter…

Is the issue the level of the list?

Kind regards, all input is appreciated.

Try an Element.Parameters node to see if you can find the matching name.

image

Sounds promising
Let’s delete the families without the parameter I want to overwrite.
I have 4 within the family, 3 in the project.

Hmm, now I get an other Warning,

“The parameters of the nested families are read-only.”

Hmm, it seems logic that the parameter that returns the instance name as tekst is an instance parameter, let me make it shared though.

Hmmm…no difference.

Is the instance parameter of the nested family given a value via formula in the container family?

Can you share an rvt with a single instance of the container family so we can help get to the bottom of this?

the parameters of nested components are always greyed out, the give the error of being read only. maybe knowing this it will get you a step closer. i’m also curious about the solution

hi Jacob,

I did just made it a parameter, but no results.

I do not see how it would function, without making a seperate parameter for each family.

I wil send you the project…

Uploading: Marignan naamgeeftest 03.rvt…

1 Like

'geveldragers naam geven 11.dyn (25.5 KB)

I hope it was the complete model, nice weekend to everybody!

1 Like

link to the model…

I got one step further by adressing Family Type parameters.
Now he overwrites the parameter of àll the families

But he returns the family name, not the typename…

I can be wrong… I used …


image

That was my first thought, there are a number of build-in Parameters you can use for this purpose…

But apparently Revit doesn’t allows instance parameters of a shared family to be changed when hosted in another family. Not even by Dynamo.

Therefore I decided to put al the metadata in the name of the instance, and do I want dynamo to write this name to this text parameter.