Clockwork - View is View Template problem

I modified the python by @Mostafa_El_Ayoubi in the above post to give a list of all view templates, not just those that are applied to a view

possibly because of the known issue where dynamo can not find 3d view templates I needed to convert the element ids to strings, the strings to numbers, and the numbers back into element ids before removing nulls

collect all view templates.dyn (20.8 KB)

"
# forked from Mostafa_El_Ayoubi
# https://forum.dynamobim.com/t/delete-view-templates-not-in-use/5327
# OUT templates
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

views = FilteredElementCollector(doc).OfClass(View)
appliedtemplates = [v.ViewTemplateId for v in views]
templates = [v.Id for v in views if v.IsTemplate == True]

OUT = templates
";