Skip to main content

Posts

Showing posts from July, 2017

Does the parameter exist?

I'm back after a while with a new article on Dynamo. This time I'll try to explain how to check if a list of parameters are available in the project. This can be used as starting point to QA a model against a pre-defined template.

The idea is pretty simple: we need to extract all the parameters from the model and to do this we list all the elements of type "ParameterElement". You'll get the list of both shared and project paraemters in this way.
Then we can extract the paraemters names and create a list of paraemter that we want to check (this list can be also an input from Excel).
Whit a simple Python script that compares all the parameters name, agains the list of predifined parameters, we can easily extract two lists: the first is the list of matched and the second is the list of unmatched. This is the python code. import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list i…