Cleaning Shared Parameters

Cleaning Shared Parameters

H.echeva
Advocate Advocate
652 Views
1 Reply
Message 1 of 2

Cleaning Shared Parameters

H.echeva
Advocate
Advocate

Hello,

I am trying to clean the shared parameters that are in our office project template. This a quite old template that was in the office before I joined.

Using the Revit Lool Up plugin I have seen that many of these parameters have an INVALID value in the ParameterGroup inside the definition. Is it safe to assume that these parameters are no longer used and delete them?

 

I have used the code below to get a list of parameters that have INVALID group:

 

public void GetInvalidGroupSharedParameters()
		{
			Document doc = this.ActiveUIDocument.Document;
			
			FilteredElementCollector collector = new FilteredElementCollector(doc);
			
			collector.OfClass(typeof(SharedParameterElement));
			
			string listofparameters = "Invalid group parameters: \n";
			
			foreach (SharedParameterElement e in collector) 
			{
				Definition def = e.GetDefinition();
				if(def.ParameterGroup== BuiltInParameterGroup.INVALID) listofparameters += def.Name + Environment.NewLine;
			}
			
			TaskDialog.Show("test",listofparameters);
		}

 

 

With this, I get a quite big list of parameters that I don't recognize and there are even duplicates.

 

sharedparameters.png

Do you think this is a good approach to find no longer used Shared Parameters? Do you have any alternative suggestions to do this?

Many thanks in advance.

 

 

0 Likes
Accepted solutions (1)
653 Views
1 Reply
Reply (1)
Message 2 of 2

David_Robison
Advocate
Advocate
Accepted solution

INVALID parameters show up in the "Other" section of the "Properties" window. They are still visible to the user so they might be used. My add-in intentionally puts parameters there. The only way to know for sure whether the parameters are being used is to ask the other people at the office.

invalid-properties.png