TypeError: expected List[Line], got list

Hi EveryBody. I’m trying to use the SpaceAnalysis Package inside python. When I try to create a SpaceLattice this error comes:

TypeError: expected List[Line], got list.

input_list[5] is a list of exclusively lines, so I don’t understand it.

Any Ideas??
Thank you very much in advance!


you can try the following:

import clr
from System.Collections.Generic import List

from Autodesk.DesignScript.Geometry import Line

list_with_lines = List[Line](input_list[5])

This explicitly tells Python that it is a List[Line].

1 Like

it’s worth reading about whats going on here:

generic types (including generic lists) are a feature of .net/c# - python lists are not the same as the generic list of line the function is expecting… but since ironPython is built on .net you can create a .net List using the syntax above.


Thank you! That was it .