Dictionary not working

I’m working on a script that will assign view templates based on a structured view name. The step that builds the list of view templates to write from the dictionary of view templates doesn’t extract the data correctly.

ApplyViewTemplates_rebuild_temp.dyn (165.2 KB)

Here’s the sample project i’m testing it on
https://microdeskco-my.sharepoint.com/:u:/g/personal/mclough_microdesk_com/EcDJRfFwHdVOjm65K3QUomEBwrcyUoQQUJIaSHgamMkH-A?e=MpNQOW

I’m not sure what causes it to fail to retrieve the correct values from the dict.

Does this help at all? @Ewan_Opie gave me a python script that gives me templates awhile back.

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

views = UnwrapElement(IN[0])
template_list = []
not_template_list=[]

for view in views:
	try:
		if view.IsTemplate:
			template_list.append(view)
		else:
			not_template_list.append(view)
	except:
		not_template_list.append(view)

OUT = template_list,not_template_list

2 Likes

I was using an old dictionary node from the LunchBox package.
Using the new core dictionary nodes resolved this issue