FamilyDocument.AddSharedParameter Errors

I’ve tried several options and can’t get past this error. Using Rhythm and Orchid latest builds on Dynamo 2.0.1 in Revit 2018.3.1. What could cause the displayed error? I need this node to close the background opened docs and save the families it opens…
@john_pierson @erfajo

Your AddSharedParameter node is missing inputs.

I had those inputs plugged with code at one point, but that introduced other errors on that particular node. With them missing the inputs, no warning is displayed which leads me to believe its working without that info…

It’s not really. Your output is a Function not an actual object. It’s not really failing but it’s incomplete. There should be built in nodes (originally from Archi-lab) specifically for those inputs if you’re having trouble.

So when I plug in “type”, I get the following error:
This SP was built as a material param, this shouldn’t be controllable…
image

The group inputs have “PG_” in front of them. I think you’re looking for PG_MATERIALS.
Look at some of the other posts for examples.
https://forum.dynamobim.com/t/add-shared-parameters-to-some-families-orchid-package/21254/11

2 Likes

I’ve tried PG_Material PG_Materials PG_MATERIAL PG_MATERIALS for “group” code. I’ve tried putting PG_ in front of GroupName, Type, Group & Instance - I get the same error back each time of Invalid Parameter Type.

Just for fun (not), I created a new Shared Parameter file just to see if it was my SP file causing issues. Same problem. I even removed the prefix "TD" from the SP Group name in the event it was messing with the PG prefix - same problem.

Thanks @erfajo - following the layout as you have it works like a charm. Setting the code block for //Parameter Group to “PG_MATERIALS” placed the shared parameters in the Revit category “Materials and Finishes” as desired. Since this obviously doesn’t follow the name displayed in Revit, do you have a listing of each of the different parameter groups or a way to define the logic used to extrapolate how a name is derived for input here?

Also, if I have 3 sets of parameters to add, one set to Materials and Finishes, one set to Identity Data and one to Other, can I have one Dynamo file that runs all 3 sets at once, just as 3 separate groups?

Thanks again for the follow up, I found the built-in node you mentioned and that has most of them. One group we use that I didn’t see an equivalent for in the list is “Other”. Is there no way to assign a parameter to this group?

Hi,
The ParameterGroup for Other you are looking for is “INVALID”. The name is quite strange indeed.

Other

2 Likes

Thanks @Alban_de_Chasteigner - I was avoiding that since I was unsure what would happen using it!

Hi everyone! I am new to the community but have been browsing for a little while.

I am having the issue shown by the original poster in that the Document.Close node is reporting the wrong input type from Parameter.AddSharedParameter (it should be ‘document’ but instead is ‘function’.)

When I run the script, it seems to work. All of the files rapidly open and close until they’re all done, then after a few seconds the script ends and the error/warning is shown. When I open the files, the shared parameter hasn’t been added.

I’ve downloaded the script posted by @erfajo and have changed the inputs to match what I am trying to do however I still get the same error. I am using “INVALID” as the parameter group (“Other”) but have also tried others, including “PG_MATERIALS” but still get the error.

Can somebody please help me and let me know what I am doing wrong? Is there perhaps an add-in that I do not have? I am using Orchid and Rhythm with Dynamo 2.0.2/Revit 2019.

Thanks!

Thanks for your help @erfajo ! I managed to get it working now through a couple of simple steps. I had to set the default value for the tooltip as you mentioned. Also, because I have multiple shared parameters with different parameter types, I had to create a second ‘add shared parameter’ node to pass in the different parameter type.

Now, the above worked but it would only actually save the parameters in the first document that was opened and none of the others (even though it would rapidly open and close them all). So I implemented the “await” node which seemed to work! Now I can easily add the shared parameters to all of the families with a single click!