oleframe.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (c) 2018 Manfred Moitzi
  2. # License: MIT License
  3. from .graphics import none_subclass, entity_subclass, ModernGraphicEntity, DefSubclass, DXFAttr, DXFAttributes, XType
  4. oleframe_subclass = DefSubclass('AcDbOleFrame', {
  5. 'version': DXFAttr(70), # OLE version number
  6. 'length': DXFAttr(90), # Length of binary data
  7. # 310: Binary data (multiple lines)
  8. # 1: End of OLE data (the string “OLE”)
  9. })
  10. class OLEFrame(ModernGraphicEntity):
  11. __slots__ = ()
  12. DXFATTRIBS = DXFAttributes(none_subclass, entity_subclass, oleframe_subclass)
  13. ole2frame_subclass = DefSubclass('AcDbOle2Frame', {
  14. 'version': DXFAttr(70), # OLE version number
  15. 'type': DXFAttr(3), # content type as string e.g. "Paintbrush Picture"
  16. 'upper_left_corner': DXFAttr(10, xtype=XType.point3d), # Upper-left corner (WCS)
  17. 'lower_right_corner': DXFAttr(11, xtype=XType.point3d), # Upper-left corner (WCS)
  18. 'ole_object_type': DXFAttr(71), # OLE object type, 1 = Link; 2 = Embedded; 3 = Static
  19. 'ole_tile_mode': DXFAttr(72), # Tile mode descriptor: 0 = Object resides in model space; 1 = Object resides in paper space
  20. 'length': DXFAttr(90), # Length of binary data
  21. # 310: Binary data (multiple lines)
  22. # 1: End of OLE data (the string “OLE”)
  23. })
  24. class OLE2Frame(ModernGraphicEntity):
  25. __slots__ = ()
  26. DXFATTRIBS = DXFAttributes(none_subclass, entity_subclass, ole2frame_subclass)