how to avoid the above code block
import clr
clr.AddReference(‘RevitServices’)
from RevitServices.Persistence import DocumentManager
clr.AddReference(‘RevitNodes’)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Mechanical import *
clr.ImportExtensions(Revit.Elements)
doc = DocumentManager.Instance.CurrentDBDocument
a =
fname = FilteredElementCollector(doc).OfClass(ViewFamilyType).ToElements()
OUT = fname
or what you mean is output the name from python code?
Kulkul
September 10, 2018, 4:43pm
3
Hi @shibujoseukken ,
Is that what you’re expecting ?
import clr
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
names=[]
views = FilteredElementCollector(doc).OfClass(ViewFamilyType).ToElements()
for view in views :
names.append(view.FamilyName)
OUT = views, names
http://www.revitapidocs.com/2018/10de5c66-1b4b-9214-4036-27a6b24e5703.htm
1 Like
@shibujoseukken , please refrain from duplicate posts.
Check the API docs as noted above, or ask it if it has a name via a quick code block:
a.Name!=null;