Skip to content

Instantly share code, notes, and snippets.

@johnpierson
Created March 24, 2020 22:34
Show Gist options
  • Save johnpierson/351c9d398b8bce2a2b9181540f784b5c to your computer and use it in GitHub Desktop.
Save johnpierson/351c9d398b8bce2a2b9181540f784b5c to your computer and use it in GitHub Desktop.
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
# toggle to refresh
refresh = UnwrapElement(IN[0])
# collect all non view template views
nonTemplateViews = filter(lambda v: not v.IsTemplate,FilteredElementCollector(doc).OfClass(View))
# 1. convert the view name to lowercase with no spaces
# 2. combine all the view names into one big 'ol string
bigOlFreakingName = "".join(map(lambda v: v.Name.Replace(" ","").lower(),nonTemplateViews))
# output the big ol string
OUT = bigOlFreakingName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment