Redundant Parameters in View Elements

I got a strange phenomenon in Revit 2022.1 . “View Template” appears twice in the elements’ parameters. The actual value is set in the 1st or 2nd one – the other being null. There is no redundant project or shared parameter that I see in the RVT.
image
or
image

Anyway, since the other get element parameter (even brute force) nodes are not consistently finding the parameter values, this is a workaround:

1 Like

Is there a more efficient way of finding elements’ parameter values when there are redundant parameter names in an RVT?

In this case, you could check the ElementId instead of the name. For whatever reason Revit only tracks the readable name in one of the parameters, but correctly tracks the element in both.

Can you share the Python?

Absolutely. I meant to do that the first time.

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

views = UnwrapElement(IN[0])
values = []

for view in views:
	param = view.LookupParameter("View Template")
	value = param.AsElementId()
	el = doc.GetElement(value)
	if el != None:
		name = el.Name
	else:
		name = "None"
	values.append(name)
	
OUT = values
1 Like

Thanks!


Working Revit 2022.1 IronPython2 code:

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
views = UnwrapElement(IN[0])
values = []
doc = DocumentManager.Instance.CurrentDBDocument
for view in views:
	param = view.LookupParameter("View Template")
	value = param.AsElementId()
	el = doc.GetElement(value)
	if el != None:
		name = el.Name
	else:
		name = "<None>"
	values.append(name)
OUT = values