Clicky Web Analytics
presentation
documentation
creation
automation
bim after dark live

Monday, November 16, 2015

Practical Dynamo - Apply Parameter Values (Using Saved Selection Sets)




For the next installment of the "Practical Dynamo" mini-series I am going to expand on the last script (which utilized Dynamo to apply parameter values to multiple objects).  The previous script worked but you have to manually select the elements and add them to your node in Dynamo.  This can be cumbersome and also cause you to select elements twice if you are trying to add something like a building area parameter.

My first solution was creating save selection sets... Then using those sets to isolate the elements, select the elements in Dynamo, run the script, un-isolate, and repeat... Yeah, I know...  It sounds ridiculous.  Well, my first rule of thumb in Revit (and now Dynamo) is if it seems like its taking too long there is probably a better way to do it... So I found a better way...




Dynamo Script : Applying Parameter Values by Saved Selection Set


(Click to enlarge..)


Pretty, isn't it?

First thing you need to know when trying to recreate this script is that I am using some custom nodes from the "Clockworks" package.  There are hundreds of awesome people creating and sharing custom packages with VERY useful nodes... Click here for the package manager...

Right now, I have the following packages installed: DynaWorks15, archi-lab.net, Raindrops, and Clockwork for Dynamo... Whenever you find yourself recreating a script and you can't find the node in your library it is probably a package.

To use the script, you need to have an instance Project Parameter with all categories selected.  In my example it is called "Turner Precon - Phasing".  Create this parameter by going to the Manage tab, Project Parameters, Add...,, and here is the parameter setup (notice all of the categories are checked)...



Now, select and save your selection sets...  Make the names something easy so you can type them in Dynamo without double checking.  Notice in my example the selection sets in the code block beneath the yellow note.  Those are my selection sets in the model.

Right now, you have to manually plug in one selection set, run dynamo, plug in the next, run dynamo, etc...  If there is someone out there who can write a python or design script that will cycle through that list in a single run, PLEASE EMAIL ME!

Anyways, as you can see your elements within the selection set will now have that selection sets name in the project parameter you created!

HOW COOL IS THAT!?