Python filter type problem

Hi,
I am stuck here, as I want to filter only line from python script. I already used GetType() for the following result:
image
Thanks!!!

If you want 0 index from that list try typing:

a[2][0];

into the codeblock

An example

4 Likes

thank a lot!!!

I have another problem, how can I keep list L3 and flatten the rest in python?
image

I tried to use flatten in python
List.Flatten(t1@@L3<1>, -1)
but seems I have warning for the @

Dunno if that’ll help?

1 Like

Oh and this:

1 Like

yes it helps :slight_smile:
but I want to keep L3 level after flatten in python too :frowning:

Best to start a new thread btw. :smiley:

1 Like

There isn’t really a need to do this with Python.
Check out List.RemoveIfNot, it’s OOTB and does exactly what you want :smiley:

For the type input use something like this: Autodesk.DesignScript.Geometry.Line

1 Like

[quote=“Daan, post:11, topic:74745”] :slight_smile:
There isn’t really a need to do this with Python.
Check out List.RemoveIfNot , it’s OOTB and does exactly what you want :smiley:
[/quote]

yes, but it was to answer the request (“Python” in the topic title) :slight_smile:

1 Like

You want to delete the first 2 levels or flat the L3 level ?