2020 C# Code Error

2020 C# Code Error

CHtCAD
Participant Participant
549 Views
1 Reply
Message 1 of 2

2020 C# Code Error

CHtCAD
Participant
Participant

Hi,

We keep coming up with the attached error when running one of the button commands in a legacy tool we had developed by a third party. The tool generates schedules from an assembly and re-numbers the items in order. The code has worked fine in 2017 up to 2019. We have just moved to 2020 and the attached error on the snip attached keeps coming up when we run the command. There must have been a change to the Revit API in 2020 which has broken it. We have the source code in C# which we can recompile.

Any ideas anyone? Error attached.

0 Likes
550 Views
1 Reply
Reply (1)
Message 2 of 2

RPTHOMAS108
Mentor
Mentor

This is likely not a quick fix in terms of changing one member for another because the UI functionality changed in 2019, after 2019 you could use (both AND and OR rule combinations).

 

Extract from 'What's New' section' 2019 API:

"ParameterFilterElement.SetRules() <Replaced with> ParameterFilterElement.SetElementFilter() The new function sets the ParameterFilterElement to contain an ElementFilter representing the combination of filter rules."

 

So you need to create an equivalent ElementFilter (to your previous AND filter rule collection).

0 Likes