Skip to content
Discussion options

You must be logged in to vote

I added an example for that task.

def main(filename: str):
    source_doc = ezdxf.readfile(CWD / filename)
    source_msp = source_doc.modelspace()
    # create an EntityQuery container with all entities from the modelspace
    source_entities = source_msp.query()
    # get all layer names from entities in the modelspace:
    all_layer_names = [e.dxf.layer for e in source_entities]
    # remove unwanted layers if needed

    for layer_name in all_layer_names:
        # create a new document for each layer with the same DXF version as the
        # source file
        layer_doc = ezdxf.new(dxfversion=source_doc.dxfversion)
        layer_msp = layer_doc.modelspace()
        importer = Importer

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@vikm2o
Comment options

@vikm2o
Comment options

Answer selected by vikm2o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants