ICollection MakeGenericType on non-generic type

Hi all !

I’m having issue with creating an ICollection. The end goal is to create ParameterFilterElement whose method require an ICollection. Maybe a Reference issue ?

import clr

clr.AddReference('ProtoGeometry')
clr.AddReference('DSCoreNodes')
clr.AddReference('RevitAPI')

import System
clr.AddReference('System.Core')

from DSCore import *
from Autodesk.DesignScript.Geometry import *
from Autodesk.Revit.DB import*

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc=DocumentManager.Instance.CurrentDBDocument

typed_categ = List[ElementId]()

OUT=typed_categ

Hi @raphael.georges1

Use this to import System:

clr.AddReference('System')
from System.Collections.Generic import *

So I guess I’m doing wrong somewhere else in this other script ? The same error occurs.
image

Hello @raphael.georges1
There a conflict with DScore namespace, an example of workaround using alias or Remove import DSCore if you don’t use it

1 Like

Clever, it works ! Merci :slight_smile:

1 Like