Renaming View Templates

Hello to all,
is it possible to rename view templates using Dynamo?

Thanks in advance!

Yup,

1 Like

Thanks Myr!
It worked perfectly! :clap::clap::clap:

Is there a way to do this as a “find & replace” like with view names/schedule names/etc…:

1 Like

@melissa.evans Just done same thing this morning…

here is the phyton code (credits to the original uploader of the code):

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

i just tweak it a bit to suit my needs

5 Likes

Thank you for Script this really helps to collect all the view templates with ID’s but view templates created under 3D views are been null
image
Is there a way to get the 3D view templates also?

Unfortunately 3D View templates cannot be passed through nodes in Dynamo. The only way to work with them is within a block of Python where you get them and do what you need to with them in that same block.

Should you wish to reference them outside that block I suggest using their name, then finding the matching name in a later block of Python as a means of identifying them specifically.

1 Like