Shared parameter keeps value when removed?

Hello

Im new here - hope you guys can help me.

I’ve created a script for calculating areas for apartments with their share of the stairs. Thats because we share the stair areas to the serving apartments in the early stages of projects.

In order to make this script i made 2 shared parameters in Revit - one for which staircase the apartment belongs to and one for the area plus the share from the stair.

All of this works fine for me, and it calculates the areas correctly. BUT when I remove one apartment from the calculation by removing the text for ‘belonging to staircase X’ for example it still keeps the value it calculated before. Så the tag i made still shows the area before.

Is there a way to reset them? So the parameter is empty?

Thanks.

Have the ones with no association receive an empty string or their area without the stair share as the value.

1 Like

I’ve had to do this before with similar scripts. Just like Jacob suggested, my script first starts by clearing out all values and then writes to parameters that have a valid association with another object. That way I’m essentially starting from scratch every time and only the elements with a current association get values.

2 Likes

Of course! Thanks Nick and Jacob.

i usualy make a schedule, sort by the parameter and uncheck itemize all instances and clear the cell, thats less mouse clicks :slight_smile:

1 Like