Get Parameter Names grouped by Type (How to?)

I’m trying to Delete all Shared Parameters except for those of the type Length or those in the group Dimensions

So far, the only way I’ve managed to do this is by getting the names of used parameters associated to dimensions, comparing those names to all the existing parameters, and deleting the unused ones.

Since I’m a new user, I can’t upload the script.

Can you think of a way to get all the parameters under a certain parameter type?

Purge Parameters.dyn (9.0 KB)

Hey, this is a very crude way to obtain what you are looking for:

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

params=UnwrapElement(IN[0])

types=[]
groups=[]
for param in params:
	p=param.GetDefinition()
	types.append(str(p.ParameterType))
	groups.append(str(p.ParameterGroup))

OUT=types,groups

I am exporting the types and groups as strings so you can manage them in dynamo as usual

Here is the ParametrGroup enum for reference:
http://www.revitapidocs.com/2018.1/9942b791-2892-0658-303e-abf99675c5a6.htm

1 Like

You Rock!

Thanks a lot!

1 Like