Technique - Global Parameters to Store Default Inputs in Data-Shapes

I’m sharing an idea/technique and not a script or package, hope this is still the right place!

This might be an obvious idea to some, but it took me 3+ years of scripting to come up with it so I thought I’d share.

I use data-shapes inputs for all scripts that require user input. When possible, I’ve began storing users input values as global parameters within the model. The scripts create a Global Parameter named “[Abbrev’dScriptName] DefaultFilepath” or if it already exists, it will updates it with the user’s input value. This technique reduces need for manual input when the script is run repeatedly.

Example of this for filepaths:
If the parameter already exists, script will read the value and push it to the default filepath in the Data-Shapes input screen. The user can just accept the inputs with no browsing if they’ve picked the filepath in a previous run. After the inputs are made, the script will update the Global Parameter with the filepath string, which stores the new filepath if the user changes it.

5 Likes

Definitely a great idea, I’ve used project information before myself but global parameters seems like a creative approach! The only limitation I’ve come across is that in a workshared environment sometimes people wont own the parameters, so an alternative is to store settings file(s) outside Revit in a shared location to read/write from.

1 Like

Hi @steinah6 ,

Good approach/idea!
At my project do we use the ACC-environment to store our Revit models and other stuff, we also have a dedicated folder on there with Excel-files containing data which the enter user needs to run the script, i.e. a small database, similar to @GavinCrump approached it I think.

Since everyone has access to this ACC-environment everyone can read this data when necessary. The only thing we had to add was a simple Python script which reads the current userprofile since everyone has the ACC on his/hers C-drive.

This also comes in handy because we receive & send a lot of AutoCAD-models where Dynamo scripts are used to make the process more streamlined. So we are not limited the data stored in 1 AutoCAD/Revit model.

And in addition to that can we use the same “infrastructure” for Revit, Civil, Sandbox, etc. since the parameter/settings storage does not lie within the host software.

1 Like