Saving drop-down settings

How can I save what a drop-down list is set to between runs of a script.
For example, I’m using the archilab View.Duplicate node, which takes an input from the Duplicate Options node.
For this instance in my script, I ALWAYS want to have the Options node set to “Duplicate”
But often when I first open it in the editor, the Options node has no value.
If there’s a default for the node, that’s not going to work for me either. There’s another place I need it set to “Duplicate as Dependent”
I want each node to remember what I set it to when I last saved the file.
It’s not just this node, either. I’ve also run into the same problem with other nodes,
Duplicate%20Options

After setting it, what is the object type? If it’s a string, element ID, or value, this could rather easily be accomplished via the UI nodes in the Datashapes package.

Apparently, that Design Options node just passes a string, so I can just do it myself.
But I could swear I’ve seen this happen with other nodes - where it doesn’t remember it’s setting - so I was kind of asking as a generic question.

For the most part, those settings are saved in the .dyn and stored correctly.

However, when nodes update between versions, or are changed in the package which references them, this default can be lost in the shuffle. If you find that these defaults are frequently being lost, confirm that all users have a consistent Revit build, Dynamo build, and associated package version.

Hi!

I am having difficulties with this too. We use several versions of Revit, so I have noticed that if I attempt to open the graph and run it in the various versions, it loses the value set in the drop down of the node… the Views node for example. I would ultimately like to load this graph with Dynamo Player, so not sure if using a drop-down node in this way is the best approach. Any suggestions?

Remember that nodes selecting Revit objects need to be able to find that object in order to select it. If the object doesn’t exist in the current model Dynamo can’t select it and the node will error.

As for Dynamo Player, if you want the user to select something you’ll need to use Data-Shapes or another UI package.

1 Like