How to avoid code block

image

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

image

or what you mean is output the name from python code?

@shibujoseukken Look at api docs:

http://www.revitapidocs.com/2018/e372092e-ff47-71c2-1272-50ab08e5a41d.htm

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.