ScheduleFilter & Add.Filter Error

Hi everyone,
in revit 2024/dynamo v.2.17.0 , i’m trying to filter a multicategory schedule by a specific category.
I have some problems with the nodes “ScheduleFilter.ByFieldTypeAndValue” and “ScheduleView.AddFilters”.

I create a schedule with the revit UI and this is what dynamo tell me about the filter’s properties:

  1. field = category
  2. filter type = equal
  3. value = categoryID

Unfortunately, if i try to create the filter in dynamo with the same properties, the node gives an error:
“operation failed. Unable to cast object of type system.int64 to type Revit.elements.element”

If i transform the categoryID (filter.value) to a string value, the filter.node seems to work, but the node ScheduleView.AddFilters doesn’t:
“operation failed. the filter value is not valid for the filter and filter type”

could someone help me? I read in the forum that in Dynamo sometimes the filter node is not working. Probably the only solution is python but I barely know Dynamo

Thanks

PS if you need files here’s the link:

Does the filter work when you add it manually?

Hi! yes, the filter created in revit UI work’s perfectly.
For what i see the filter.node works only with precise combination of input. For example, with “string value” it’s better to use “contains” because “equal” doesn’t work.

I think there is some limitation inside the node and it doesn’t accept “category” as field:
I manage to transform the “categoryID” from integer to double value, and now the filter.node it’s working.
But the add.filter node give another error message: “operation failed. the field and the filter type cannot be used to filter thi schedule.definition”.

Similar problem. No solution.

Also (from an older topic) this.

Thanks Bas, same articles that i was reading.
I was hoping that in this last years something was fixed or maybe in a workaround.
If I won’t find a way in the next few days, I’ll mark you as “solution”.
Thank you for your time!!!