Replies: 1 comment
-
You can here learn how ezdxf/src/ezdxf/filemanagement.py Line 138 in 0f0ac03 if is_binary_dxf_file(filename):
with open(filename, "rb") as fp:
data = fp.read()
loader = binary_tags_loader(data, errors=errors)
doc = Drawing.load(loader)
doc.filename = filename
return doc BTW: Writing Binary DXF files is not faster than writing ASCII-DXF files and has some edge cases where the DXF file cannot be read by AutoCAD. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently writing to a BytesIO in the following way:
with BytesIO() as buffer:
doc.write(buffer, fmt="bin")
buffer.seek(0)
binary_file = buffer.read()
I am looking or a way to open the binary_file with ezdxf at a later stage.
Currently I have tried:
ezdxf.read(BytesIO(binary_file))
But than i get the following error:
raise DXFStructureError(f'Invalid group code "{code}" at line {line}.')
ezdxf.lldxf.const.DXFStructureError: Invalid group code "b'AutoCAD Binary DXF\r\n'" at line 1.
Anyone know how I can solve this problem?
Beta Was this translation helpful? Give feedback.
All reactions