mclough
January 24, 2019, 10:55pm
1
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.
vanman
January 25, 2019, 12:46am
2
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
Hi,
Trying to get a list of all view templates available in a document to use in a UI.dropdown data input. Any help? i’m not sure how to extract the list from the View Templates drop down node.
[image]
2 Likes
I was using an old dictionary node from the LunchBox package.
Using the new core dictionary nodes resolved this issue