I’m having trouble creating a IList for an ElementMultiClassFilter. I’ve tried the following:
from System import Type
type_list = List[Type]()
It throws an invalid cast exception and I am stuck. Does any of you know how it should be done?
The exception is:
System.InvalidCastException: Error in IEnumeratorOfTWrapper.Current. Could not cast: System.Type in IronPython.Runtime.Types.PythonType ---> System.InvalidCastException: Unable to cast object of type 'IronPython.Runtime.Types.PythonType' to type 'System.Type'.
at IronPython.Runtime.IEnumeratorOfTWrapper`1.get_Current()
--- End of inner exception stack trace ---
at Microsoft.Scripting.Interpreter.NewInstruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)