Hello @PiotrS
changing the selection mode is not enough you have to change the class that filters the selection
import clr
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
sel1 = uidoc.Selection
obt1 = Selection.ObjectType.Face
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
class CustomISelectionFilter(Selection.ISelectionFilter):
def __init__(self, lst_f):
self.lst_f = lst_f
def AllowElement(self, e):
return True
def AllowReference(self, ref, point):
if ref.ConvertToStableRepresentation(doc) not in self.lst_f:
return True
else:
return False
out1 = []
lst_filter = []
flag = True
while flag:
try:
ref_1 = sel1.PickObject(obt1, CustomISelectionFilter(lst_filter), "Select a Face, type escape to finish")
el1 = doc.GetElement(ref_1)
face = el1.GetGeometryObjectFromReference(ref_1)
out1.extend(face.ToProtoType())
lst_filter.append(ref_1.ConvertToStableRepresentation(doc))
except :
flag = False
OUT = out1
also you can also use the node from @chuongpqvn 