pythonautocadezdxf

Get a list of autocad layers with edzxf


I want to get a list of autocad layer names with ezdxf.

I have referenced the ezdxf documentation but I do not know how.

The following is described in the documentation, do you use this?

Drawing.layout_names()
  Get a list of available paper space layouts.

Please tell me an example of how to use it.


Solution

  • As a very basic example:

    import ezdxf
    
    dwg = ezdxf.new()
    for layer in dwg.layers:
        print layer.dxf.name