The goal of the graph on which I was working when I needed to know how to add Shared Parameters to the Other Parameter Group was to allow a user to easily add additional shared parameters that we use to track issued Sheets in our Drawing List Schedule. Our template files have the first ten of these in them, and for some projects, that is enough. Others have many more than ten issuances, particularly those that track issuances during the design phases. We have twenty additional Shared Parameters in our Shared Parameter file; adding more than one of them is tedious, at best.
Using the Parameter.AddSharedParameter node from Erik Falck Jørgensen's Orchid package makes it easy to bulk-add Shared Parameters in a Dynamo graph. For this particular task, however, I wanted to be able to offer the end user the choice of adding the second group of ten parameters, the third group of ten parameters or both the second and third groups of ten parameters, without creating separate graphs for each group of ten additional parameters, and without the user having to go into the graph and make adjustments.
My solution was to use a Python Script node to handle the user options. Two separate lists of the Shared Parameter names are created, and two Boolean nodes with Is Inupt set allow the user to choose to include one or both of those lists when the graph is run. The Python Script node has four inputs; two for the lists (IN and IN) and two for the Boolean nodes (IN and IN). The image below shows the simple Python code that gathers the input values and then tests the Boolean values, adding the associated list of Shared Parameter names to the output list if the Boolean is set to True.
In Dynamo Player, when the user finds the graph file and selects the Edit Inputs tool, this is what she or he sees:
The switch turns green when set to True. Once the desired list(s) are set to True, selecting the Play tool will run the graph and the selected Shared Parameters will be added to the active project. The Parameter List result will display a list of the names of the Shared Parameters that were added.
As always, you can select an image to see it full size.
Post a Comment