Hello,
I’m trying to create schedule filter by means of ScheduleView.AddFilters and get the following error: The filter value is not valid for the field and filter type. Parameter name: filter
Any ideas of fixing it?
I have searched through this forum and found a couple of old topics. In one topic this node works good, in another topic a user had the same problem with no solution…
I have also tried to feed “sheduleView” and “sheduleFilters” parameters with single-item lists in different combinations.
Hello, Kulkul.
Thank you for the example. I have made the same and it works for me too (this is for a text parameter).
But I’m trying to create a filter, for example, “less than” for a numerical parameter. Can you do this?
I have a space schedule. AddFilter works fine for the text parameter “Space name”
I may be going the wrong direction here, but can you confirm that you can use a less than filter on a string value like this using the Revit UI? I believe that the options for filters change based on the parameter types.
This confirms that aardvark is in face less than an elephant, which is less than a mosquito… all of which are less than a zebra. Pretty sure there is a kindergarten down the street which teaches that… shoulda guessed it.
Seriously though, careful using strings as integers - unexpected results may occur.
Room: Area and your space height are number parameters are they not? You’re setting up your filters for numbers less than the string “10” and “3000”. They have to be numbers, not strings…
Thanks for the replying to everyone.
The Node ScheduleFilter.AddFilter requires the value parameter as a string or a number (depends on a filter type).
And I have just understood my error. Explain it here, maybe it will help to somebody.
I am trying to set a value in filter in mm. This returns an error.
But if I set a value in ft, a schedule filter will be created. Everything works.
4500 mm = 14,76378 ft.
So, what’s the maximum number parameter value for schedule filter?
It’s 9144000 mm = 30000 ft.
And a very important feature.
A number value must have a fraction or the tailing “.0”.
This is why I have gotten an error, when trying to set “4500”, not “4500 .0”.
So, this is my excuse, that I have been trying to insert the string “1” to a number parameter… At least, it hasn’t returned an error in the node ScheduleView.ByFieldTypeAndValue.
When I was trying to set 4500 it returned an error in this node…
Who knew, that “4500” and “4500.0” in Code Block node results in different variable types.