Change Family type parameter to instance parameter

Hi Daan, I’ve added the List.Indexof and GetItemAtIndex nodes, maybe not in the right place :frowning: but it still not working as the final node shows up as “success list = false”
Appreciate your help on this. See screenshot.

Could you share your Dynamo file? I see your mistake but it would be easier to change it myself :slight_smile:

seems it will work only in family parameter not in shared parameter… I am looking for a way around…

Hi Daan, here’s my script. I was playing around with Levels and Lacing but still no joy. :thinking: AGTypeOrInstance.dyn (32.9 KB)

1 Like

Could you try this change?

AGTypeOrInstance - Changed.dyn (14.8 KB)

PS: look closely which way the data streams, then you will also understand what is going on :slight_smile:

1 Like

Hi Vijay, it changes all the shared parameters. As far as I can workout, they all change to Type or Instance depending on what node you choose. Hopefully @Daan has resolved this for me :crossed_fingers:

1 Like

Daan you are a star :star2: Thank you so much for this as I wouldn’t resolve this on my own. I’ve got a lot of learning to do!! Still don’t understand the stream to be honest :thinking:

1 Like

Okay i’ll try to explain :slight_smile:

The FamilyDocument.FamilyParameters extracts all parameters from the family.
These parameters have names, but also other properties, like their values, but we want to filter on their names.
So we extract the parameter name using the element.name+ node (you could also use the Parameter.Name node btw)

Now we use the List.IndexOf Node to see which indices match up to your “Input” list in the Code Block.
This will result in a list with numbers, aka Indices.

These numbers are not connected to anything yet, they are just matching numbers, so then we need to use the List.GetItemAtIndex to get all the items we need from their corresponding indices (the numbers we just filtered)

Because you used the name in the List.GetItemAtIndex node, it wouldn’t work, because the FamilyParatemer.MakeType node expects a Family Parameter and not the name of the Family Parameter. That is why we use the Parameters as List, instead of just the names.

we can filter which want to change…

Hi Daan, thanks for explaining it to me.
What I didn’t appreciate was the input in to the FP.MakeType node as I was just feeding it a list of strings var and not the Family Parameter. This is where I find Dynamo difficult on trying to understand the errors it throws up because of wrong information being parsed.
Have you got any information for understanding errors and how to resolve them?
Many thanks for your help. :grinning:

1 Like

Hi Vijay, Daan has resolved this for me, but thanks for reaching out to try and help me.

1 Like

Well the FamilyParameter.MakeType node is a Custom Node, so you can only see from the input name what they expect you to put in, but when using OOTB nodes, the errors will always say what they expect and what they recieved. :slight_smile:

Also the Dynamo Dictionary is a great tool to help:

happy to helped you…

1 Like

This is where I find it difficult with custom nodes as I was just expecting to input a list. But I will keep at it as when you get a script to work it makes your day…as well as all of the time saving! :laughing:

cheers