Replies: 3 comments 2 replies
-
Many thanks mozman for this fast answer and your help! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
Updated code to work with newer versions of OLE2FRAMES are stored as import ezdxf
def main():
doc = ezdxf.readfile("your.dxf")
msp = doc.modelspace()
for ole in msp.query('OLE2FRAME'):
# get subclass as Tags() object
tags = ole.acdb_ole2frame
# for tag codes look:
# http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-77747CE6-82C6-4452-97ED-4CEEB38BE960
# DXF files have often missing data, therefor default to None, else DXFValueError() will raise
# for missing data
kind = tags.get_first_value(3, default=None)
corner1 = tags.get_first_value(10, default=None)
corner2 = tags.get_first_value(11, default=None)
ole_type = tags.get_first_value(71, default=None)
tile_mode = tags.get_first_value(72, default=None)
# you get the idea
# extract binary encoded data as bytes: b'\xf0\xf0...'
bin_data = b"".join(tag.value for tag in tags if tag.code == 310)
if __name__ == "__main__":
main() |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear mozman,
first let me say thanks for ezdxf!
I'm searching for a posibility to extract the data of Excel tables which are stored in OLE2FRAMES within the dxf-files. I found out that OLE2FRAMES are managed with the DXFTagStorage class. But unfortunatelly I didn't find the way to extract the OLE2 data. I also have tried to find a hint in https://ezdxf.readthedocs.io.
Would it be possible to give me a short example how to extract the OLE2 data.
Thanks and best regards,
Fortunox
Beta Was this translation helpful? Give feedback.
All reactions