I am working with python 3 in dynamo and i got stuck with ISelectionFilter. And i dont know why, even though a lot of code on the internet still working.
doc = DocumentManager.Instance.CurrentDBDocument
uidoc = uiapp.ActiveUIDocument
def AllowElement(self, element):
if element.Category.Name == "Walls":
def AllowReference(self, element):
selection_filter = MySelectionFilter()
wall = uidoc.Selection.PickObject(ObjectType.Element, selection_filter)
OUT = wall
The TypeError: interface takes exactly one argument
I think because the python 3 in dynamo revit 2024 does not support anymore.
Xinh Chao Anh Thanh!
- pyrevit does not support python 3 that well yet.
- the piece of code you provided misses the imports and seems to be a dynamo script. Not entirely the same framework, so it would need some tweaking depending on the import section
- plenty of example all around about ISelectionFilter:
The error you mention usually lists the line of the error, providing the full script + the full error text / providing context usually helps us provide with answer
Thank you alot . But I found a lot of example for that, but it sill didn’t work in dynamo. even thought i saw some doing that sucessfully on youtube.
You are in the wrong forum then. If you plan on getting things to work in dynamo, then the dynamo forum is the place to ask.