Override Item with no value

Something to try:
From ALL ELEMENTS (literally everything, which is hard to do as it’s Types, instances, and stuff you can’t necessarily select by a single node - your dropdowns list is going to be extensive).

Then use an Element.Parameters to get a list of all parameters associated to each element.

Then use a Parameter.HasValue to see which of the parameters have a value for each element (warning: You’re going to have 100,000’s of values here).

Then use a Parameter.Id to get the element ID for each parameter (not the value).

Then use a List.GroupByKey node to group all the ‘has value’ nodes by their ID.

Then use a List.AnyTrue or List.AllFalse node to a True/False value for each parameter, returning true only with everything is false from the grouped HasValue nodes.

Next use a List.FilterByBoolMask to get a list of all aprameters with which didn’t ever have a value (the list is the key from the GroupByKey and the mask is the result of the AllFalse/AnyTrue node).

Now get the parameter element and try to delete it - you might have some you cannot (Built In Parameters).

This won’t be quick, and there are likely better ways via the Revit API but this was framed as a Dynamo question so I’m assuming Nodes are your method of authoring. For something direct in the Revit API have a look at this: Delete unused Parameters, how - #2 by c.poupin

1 Like