0

I want to extract all the block attributes and put them on a df. Some of the attributes are default, and some are custom attributes: Block attributes to extract

import ezdxf as ez
import pandas as pd
doc = ez.readfile("data.dxf")

# Get the modelspace
msp = doc.modelspace()

# Initialize df with all block attributes
entities_df = pd.DataFrame()

# Iterate over all entities in the modelspace and append to df
for entity in msp:
    to_dict = pd.DataFrame([entity.attribs()])
    entities = pd.concat([entities, to_dict])
    print(blocks_df)

.attribs() is not returning every attribute. I'm getting "handle, layer, flags, text, style, name..." but not the attributes I am looking for.

Lucas Paiva
  • 5
  • 1
  • 4

0 Answers0