Reading from only one layer.

26 views
Skip to first unread message

Tom Cumming

unread,
Apr 12, 2019, 5:42:07 PM4/12/19
to python-ezdxf
I'd like to pull out entities from a specific layer. What is the best way to do this?

thx, tom.c

Tom Cumming

unread,
Apr 12, 2019, 5:59:53 PM4/12/19
to python-ezdxf
Oh, hold on a minute. There may be something wrong with my dxf file.

I have a dxf file with two layers, "0", and "gear". I tried:

>>> len(msp.query('*[layer=="0"]'))
40
>>> len(msp.query('*[layer=="gear"]'))
0

Then I created a dxf file using librecad with a circle in, "0", and a rectangle in, "gear", I get:

>>> len(msp.query('*[layer=="0"]'))
1
>>> len(msp.query('*[layer=="gear"]'))
1

Hmmm. May have answered my own question!
Reply all
Reply to author
Forward
0 new messages