FamilyDocument.AddSharedParameter Errors

orchid

#1

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


#2

Your AddSharedParameter node is missing inputs.


#3

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…


#4

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.


#5

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


#6

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.


#7

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.


#8

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.


#9

works as expected for me…
addmaterials.dyn (9.3 KB)


#10

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?


#11

Thanks for the solution mark, but I just demonstrated what @Nick_Boyts wrote, so I move the acknowledgement to him instead.

Concerning the “names” for groups and types, try using the built-in nodes and see what they send thats the feed you can use as strings.

Concerning different types/groups, then just add three “AddSharedParameter” nodes in a chain and it will work as you want it to.


#12

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?


#13

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

Other


#14

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


#15

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!


#16

when a node is light grey, then you miss an input!

I think the case is, that you have updated your GRAPH, and in the meantime have I changed the node layout. It looks like you have made the graph before I added “tooltip”. This means that you need to right click to ensure you use the “default” values… otherwise is the node waiting for you to add an input.

by the way, for FamilyDocument nodes have I today made a rather large update, please read this


#17

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!


#18

please mark the topic that solved your issue.