Add Shared Parameters to Families - Wrong Parameter Group

Hi!

I’m tring to add some shared parameters to a list of families loaded in a project file, using a python script similar the one at the following link: https://forum.dynamobim.com/t/family-document-add-shared-parameter/9425

Here is the code:

TEST-02-1

Unfortunately I realized that the parameters are correctly added to the family, but in a wrong parameter group.

Doesn’t anyone know the reason why this happens?

Thanks.

Thanks for your reply!

Well, my purpose was to manage 3 task directly in the project file where the families are loaded, feeding the node only with an xls file.

The workflow follows 3 steps:

  1. create some shared parameters in the shared parameter txt file --> DONE
  2. add some shared parameter to all elements of certain categories in the project --> DONE (here I can add the parameter in the right parameter group too!)
  3. add some shared parameter to some families, loaded in the project --> WORK IN PROGRESS!!!

Refering to point 3, I already try your node “FamilyDocument.AddSharedParameters” and I have some question to point out:

  • I can create and/or add shared parameters to the shared parameter txt of the “dummy project file” at the same time;
  • the parameter is added in the right parameter group;
  • the node work fine with list of families;
  • the modified families are not reloaded in the project file;
  • it seems that it doesn’t work whit list of parameters;

Are my previous statement correct?

Here you are some screenshot of my tests.

TEST04

TEST05

Can you please share your script in order to find all together a solution?

Here you can find a WIP version of the entire workflow, with the dynamo nodes and the xls file.

mR_CreateSharedParameters - 0.1.xlsx (24.3 KB)
mR_CreateSharedParameters - 0.1.dyn (39.9 KB)

Here you are the dynamo nodes related to the images, but I think is more useful (not only for me) to discuss about the whole workflow…

TEST05.dyn (15.8 KB)
TEST04.dyn (11.0 KB)

…and here you are the dyn related to the very first image.

TEST02.dyn (7.0 KB)

Thanks for your help…I’ll try to follow your advice on Monday.

Hi!

I tested the first “TEST06.dyn” you uploaded.
Here you are a modified version:
mR_TEST06-1_by erfajo.dyn (10.6 KB)

Well, as usual I have some question to point out:

  1. something strange happens when I use the “familytype.getfamilydocument” node:
    IN = N°3 familytypes --> OUT = N°9 family documents
    Is it normal?

  1. I tried to feed all inputs of the “FamilyDocument.AddSharedParameter” node with some lists.
    I realized that:
  • parameter name and parameter group works as a corss product lacing: I obtained N°4 shared parameters in the txt file;
  • type, group and instance takes only the first item of the list, in fact all parameters are “numbers” and have been added to the family into “model property” group as “instace” parameter.

I expected something like this:

TEST06-2bis

  1. I get this strange error, but everything seems to work anyway.
    “The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone.” Can’t anybody explain this?

Finally, the reason why in my work in progress “mR_CreateSharedParameters - 0.1.dyn” I decided to divide the 3 tasks (create shared parameters, add to categories, add to families), is to reduce the possibility of input mistake.
In adding shared parameter to categories or families, I’d like to feed the node only with family list, parameter name and parameter group, the shared parameter has been created first and alredy has a type, group and “instance boolean” (unique for categorie!).

What do you think about???

And another question, maybe I miss something: how do you solve in your script the wrong parameter group issue???

Thanks for your help.
Bye.

I refer to the question I explained in my first topic. With my script all parameters are added in the parameter group “Other”.

I see you solved the problem in your node “FamilyDocument.AddSharedParameters”, so I’m asking you what’s the mistake in my script and possibly what’s the solution. :slight_smile:

Please see the first image I publish and/or "mR_CreateSharedParameters - 0.1.dyn.

Unfortunately I can’t use your node because I have to manage a very big list of families and parameters, and I would not create a very big graph. I prefer using python to create a sort of general node, where the only input is the xls file.

Thank you again.

…so your philosofy is: “If you use my node, then I will help you”. ?? :face_with_raised_eyebrow:

Sorry but as I show you before, actualy your node can’t do what I need.

So thanks for your help, but it seems like you want to keep the secret about the method you used to add the parameters in the correct parameter group.

Anyway, I thought that this was a place where to share information and try to develop something useful for all the Dynamo community. Maybe I’m wrong.

OK let’s try…maybe I can’t understand.

Please, let me see how can I solve the following problem using Orchid nodes.

In the following excel there is the list of families and parameter I would like to add.

Orchid_AddSharedParameters.xlsx (16.8 KB)

Thanks.

…coming back to the real topic: doesn’t anybody know what’s wrong with the script in the first post??

I don’t really realize why the parameter are always added in the parameter group “Other”…

@erfajo Hello, where is the familytype.getfamily document from? is it from Orchid? i got orchid package but did not find it. please help!

Hi by using the approach you mentioned previously, I am able to create shared parameters inside the text file but they are not reflected as instance or type parameters in properties/family editor.

Can anyone please help? @erfajo

What I am trying to do is, filter a few families and add shared parameters to them. Say I have A, B, C, D families in a Project. I am trying to add instance shared parameters to A and B only. All of the families belong to the same category.

Alsi I am unable to find the node FamilyDocument.AddSharedParameters in the latest update.

I used this approach but the parameters are added/created in the text file and not reflected as instance and type parameter in the properties of the family/element.