Assigning shared parameters to categories


hello everybody,

I just finished to work on my script but have a problem whit the “createSharedParameter” becouse when i built the script for the first time it worked perfectly,creatign the shared parameters, assignign the parameter to all the rooms and filling the values whit the list on the left.

but when i close the revit file and start a new one and run the script, i can see the shared parameters in the “menage” ribbon bar but the parameter are not assigned to the rooms as therefore the values!!

split it up to two scripts. one that creates the shared parameter and one that assigns the values.

you might want to assign the values multiple times. you only want to create the shared parameters once.

1 Like

Two scripts is definitely an easier option depending on your intended workflow.

The reason this likely isn’t working is because you have nothing in your script that ensures that the parameter gets created before you write a value to it. You can do this with a transaction node to split the graph into two separate transactions: the first creates the parameter and the second sets it.

You can also add a check to see if a shared parameter by that name exists already. If it does, you can filter it out and not create a duplicate.