From d489ed74712233e704c84dce3a786a08a4bce486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Josef=20=C5=A0pa=C4=8Dek?= Date: Tue, 19 Apr 2022 06:26:27 +0200 Subject: [PATCH] From Michals CAD-Format-DWG perl modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See e.g. https://github.com/michal-josef-spacek/CAD-Format-DWG-AC1003 ... © 2021 Michal Josef Špaček BSD 2-Clause License Signed-off-by: Reini Urban --- LICENSE | 23 + dwg_ac1001.ksy | 1359 +++++++++++++++++++++++++++++++++++ dwg_ac1002.ksy | 1425 ++++++++++++++++++++++++++++++++++++ dwg_ac1003.ksy | 1475 +++++++++++++++++++++++++++++++++++++ dwg_ac1004.ksy | 1530 +++++++++++++++++++++++++++++++++++++++ dwg_ac1006.ksy | 1877 ++++++++++++++++++++++++++++++++++++++++++++++++ dwg_ac1009.ksy | 1602 +++++++++++++++++++++++++++++++++++++++++ dwg_ac1_2.ksy | 345 +++++++++ dwg_ac1_40.ksy | 370 ++++++++++ dwg_ac1_50.ksy | 1310 +++++++++++++++++++++++++++++++++ dwg_ac2_10.ksy | 1208 +++++++++++++++++++++++++++++++ 11 files changed, 12524 insertions(+) create mode 100644 LICENSE create mode 100644 dwg_ac1001.ksy create mode 100644 dwg_ac1002.ksy create mode 100644 dwg_ac1003.ksy create mode 100644 dwg_ac1004.ksy create mode 100644 dwg_ac1006.ksy create mode 100644 dwg_ac1009.ksy create mode 100644 dwg_ac1_2.ksy create mode 100644 dwg_ac1_40.ksy create mode 100644 dwg_ac1_50.ksy create mode 100644 dwg_ac2_10.ksy diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8602d2e --- /dev/null +++ b/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2021 Michal Josef Špaček +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/dwg_ac1001.ksy b/dwg_ac1001.ksy new file mode 100644 index 0000000..c96555d --- /dev/null +++ b/dwg_ac1001.ksy @@ -0,0 +1,1359 @@ +meta: + id: dwg_ac1001 + title: AutoCAD drawing (AC1001) + application: AutoCAD + file-extension: + - dwg + license: CC0-1.0 + xref: + justsolve: DWG + pronom: + fmt: 27 + mime: + - application/x-dwg + - image/vnd.dwg + wikidata: Q27863117 + endian: le +seq: + - id: header + type: header + - id: entities + type: real_entities + size: header.entities_end - header.entities_start + - id: blocks + type: block + repeat: expr + repeat-expr: header.table_block.items + - id: layers + type: layer + repeat: expr + repeat-expr: header.table_layer.items + - id: styles + type: style + repeat: expr + repeat-expr: header.table_style.items + - id: linetypes + type: linetype + repeat: expr + repeat-expr: header.table_linetype.items + - id: views + type: view + repeat: expr + repeat-expr: header.table_view.items + - id: block_entities + type: real_entities + size: header.blocks_size + - id: todo + size-eos: true + repeat: eos + if: not _io.eof +types: + block: + seq: + - id: flag + type: block_flag + doc: BLOCK/70 + - id: block_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: BLOCK/2 + - id: u2 + type: s1 + - id: u3 + type: s1 + - id: u4 + type: s1 + - id: u5 + type: s1 + - id: u6 + type: s1 + block_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + header: + seq: + - id: magic + contents: [0x41, 0x43, 0x31, 0x30, 0x30, 0x31] + doc: 0x0000-0x0005, $ACADVER + - id: zeros + size: 6 + - id: zero_one_or_three + type: s1 + - id: unknown_3 + type: s2 + - id: num_sections + type: s2 + - id: num_header_vars + type: s2 + - id: dwg_version + type: s1 + - id: entities_start + type: u4 + - id: entities_end + type: u4 + - id: blocks_start + type: u4 + - id: blocks_size_raw + type: u4 + - id: blocks_end + type: u4 + - id: unknown4b + size: 2 + - id: unknown4c + size: 2 + - id: table_block + type: table + - id: table_layer + type: table + - id: table_style + type: table + - id: table_linetype + type: table + - id: table_view + type: table + - id: variables + type: header_variables + instances: + blocks_size_unknown: + value: (blocks_size_raw & 0xff000000) >> 24 + blocks_size: + value: (blocks_size_raw & 0x00ffffff) + table: + seq: + - id: item_size + type: u2 + - id: items + type: u2 + - id: unknown + size: 2 + - id: begin + type: u4 + header_variables: + seq: + - id: insertion_base + type: point_3d + doc: 0x005e-0x0075, $INSBASE/10|20|30 + - id: num_entities + type: u2 + doc: 0x0076-0x0077 + - id: drawing_first + type: point_3d + doc: 0x0078-0x008f, $EXTMIN/10|20|30 + - id: drawing_second + type: point_3d + doc: 0x0090-0x00a7, $EXTMAX/10|20|30 + - id: limits_min + type: point_2d + doc: 0x00a8-0x00b7, $LIMMIN/10|20 + - id: limits_max + type: point_2d + doc: 0x00b8-0x00c7, $LIMMAX/10|20 + - id: view_ctrl + type: point_3d + doc: 0x00c8-0x00da, $VIEWCTRL/10|20|30 + - id: view_size + type: f8 + doc: 0x00e0-0x00e7 + - id: snap + type: s2 + doc: 0x00e8-0x00e9, $SNAPMODE + - id: snap_resolution + type: point_2d + doc: 0x00ea-0x00f9, $SNAPUNIT/10|20 + - id: snap_base + type: point_2d + doc: 0x00fa-0x0109, $SNAPBASE/10|20 + - id: snap_angle + type: f8 + doc: 0x010a-0x0111, $SNAPANG + - id: snap_style + type: s2 + doc: 0x0112-0x0113, $SNAPSTYLE + - id: snap_iso_pair + type: s2 + enum: iso_plane + doc: 0x0114-0x0115, $SNAPISOPAIR + - id: grid + type: s2 + doc: 0x0116-0x0117, $GRIDMODE + - id: grid_unit + type: point_2d + doc: 0x0118-0x0127, $GRIDUNIT/10|20 + - id: ortho + type: s2 + doc: 0x0128-0x0129, $ORTHOMODE + - id: regen + type: s2 + doc: 0x012a-0x012b, $REGENMODE + - id: fill + type: s2 + doc: 0x012c-0x012d, $FILLMODE + - id: qtext + type: s2 + doc: 0x012e-0x012f, $QTEXTMODE + - id: drag + type: s2 + doc: 0x0130-0x0131, $DRAGMODE + - id: linetype_scale + type: f8 + doc: 0x0132-0x0139, $LTSCALE + - id: text_size + type: f8 + doc: 0x013a-0x0141, $TEXTSIZE + - id: trace_width + type: f8 + doc: 0x0142-0x0149, $TRACEWID + - id: current_layer_index + type: s2 + doc: 0x014a-0x014b, $CLAYER + - id: current_color_convert + type: s2 + doc: 0x014c-0x014d, (2, 3, 8, 15 - default) + - id: unknown6 + type: f8 + doc: 0x014e-0x0155 + - id: unknown7a + type: s2 + doc: 0x0156-0x0157 + - id: unknown7b + type: s2 + doc: 0x0158-0x0159 + - id: unknown7c + type: s2 + doc: 0x015a-0x015b + - id: unknown8 + type: f8 + doc: 0x015c-0x0163 + - id: linear_units_format + enum: unit_types + type: s2 + doc: 0x0164-0x0165, $LUNITS + - id: linear_units_precision + type: s2 + doc: 0x0166-0x0167, $LUPREC + - id: axis + type: s2 + doc: 0x0168-0x0169, $AXISMODE + - id: axis_value + type: point_2d + doc: 0x016a-0x0179, $AXISUNIT/10|20 + - id: sketch_increment + type: f8 + doc: 0x017a-0x0181, $SKETCHINC + - id: fillet_radius + type: f8 + doc: $FILLETRAD + - id: units_for_angles + enum: units_for_angles + type: s2 + doc: $AUNITS + - id: angular_precision + type: s2 + doc: $AUPREC + - id: text_style_index + type: s2 + doc: 0x018e-0x018f, $TEXTSTYLE (index) + - id: osnap + enum: osnap_modes + type: s2 + doc: 0x0190-0x0191, $OSMODE + - id: attributes + enum: attributes + type: s2 + doc: 0x0192-0x0193, $ATTMODE + - id: menu + size: 15 + type: str + encoding: ASCII + terminator: 0x00 + doc: 0x0194-0x01a2, $MENU + - id: dim_scale + type: f8 + doc: 0x01a3-0x01aa, $DIMSCALE + - id: dim_arrowhead_size + type: f8 + doc: $DIMASZ + - id: dim_extension_line_offset + type: f8 + doc: $DIMEXO + - id: dim_baseline_spacing + type: f8 + doc: $DIMDLI + - id: dim_extension_line_extend + type: f8 + doc: $DIMEXE + - id: dim_maximum_tolerance_limit + type: f8 + doc: 0x01cb-0x01d2, $DIMTP + - id: dim_minimum_tolerance_limit + type: f8 + doc: 0x01d3-0x01da, $DIMTM + - id: dim_text_height + type: f8 + doc: 0x01db-0x01e2, $DIMTXT + - id: dim_center_mark_control + type: f8 + doc: 0x01e3-0x01ea, $DIMCEN + - id: dim_oblique_stroke_size + type: f8 + doc: 0x01eb-0x01f2, $DIMTSZ + - id: dim_tolerances + type: s1 + doc: 0x01f3, $DIMTOL + - id: dim_limits_default_text + type: s1 + doc: 0x01f4, $DIMLIM + - id: dim_text_ext_inside_line_position + type: s1 + doc: 0x01f5, $DIMTIH + - id: dim_text_ext_outside_line_position + type: s1 + doc: 0x01f6, $DIMTOH + - id: dim_extension_line_first_suppress + type: s1 + doc: 0x01f7, $DIMSE1 + - id: dim_extension_line_second_suppress + type: s1 + doc: 0x01f8, $DIMSE2 + - id: dim_text_vertical_position + type: s1 + doc: 0x01f9, $DIMTAD + - id: limits_check + enum: limits_check + type: s2 + doc: 0x01fa-0x01fb, $LIMCHECK + - id: unknown10 + size: 45 + - id: elevation + type: f8 + doc: 0x0229-0x0230, $ELEVATION + - id: thickness + type: f8 + doc: 0x0231-0x0238, $THICKNESS + - id: view_point + type: point_3d + doc: 0x0239-0x0251, $VIEWDIR/10|20|30 + - id: unknown_repeating + type: unknown_repeating + doc: 0x0252-0x02e0 + - id: unknown29 + type: s2 + doc: 0x02e1-0x02e2 + - id: blip + type: s2 + doc: 0x02e3-0x02e4, $BLIPMODE + - id: dim_suppression_of_zeros + type: s1 + doc: 0x02e5, $DIMZIN + - id: dim_rounding + type: f8 + doc: 0x02e6-0x02ed, $DIMRND + - id: dim_extension_line_extend2 + type: f8 + doc: 0x02ee-0x02f5, $DIMDLE + - id: dim_arrowhead_block + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMBLK + - id: unknown30 + type: s1 + - id: circle_zoom_percent + type: s2 + doc: 0x0317-0x0318 + - id: coordinates + enum: coordinates + type: s2 + doc: 0x0319-0x031a, $COORDS + - id: current_color + enum: current_color + type: s2 + doc: 256d - bylayer, 0d - byblock, other index (1-255), $CECOLOR + - id: current_linetype + type: s2 + doc: 256d - bylayer, 255d - byblock, other index, $CELTYPE + - id: create_date_days + type: u4 + doc: $TDCREATE/days + - id: create_date_ms + type: u4 + doc: $TDCREATE/ms + - id: update_date_days + type: u4 + doc: $TDUPDATE/days + - id: update_date_ms + type: u4 + doc: $TDUPDATE/ms + - id: total_editing_time_days + type: u4 + doc: $TDINDWG/days + - id: total_editing_time_ms + type: u4 + doc: $TDINDWG/ms + - id: user_elapsed_timer_days + type: u4 + doc: $TDUSRTIMER/days + - id: user_elapsed_timer_ms + type: u4 + doc: $TDUSRTIMER/ms + - id: user_timer + type: s2 + doc: 0x033f-0x0340, $USRTIMER + - id: fast_zoom + type: s1 + doc: 0x0341, $FASTZOOM + - id: unknown33 + size: 1 + - id: sketch_type + type: s1 + doc: 0x0343, $SKPOLY + - id: unknown33b + size: 7 + - id: unknown34 + type: f8 + - id: angle_base + type: f8 + doc: 0x0353-0x035a, $ANGBASE + - id: angle_direction + enum: angle_direction + type: s2 + doc: 0x035b-0x035c, $ANGDIR + instances: + create_date: + value: create_date_days + (create_date_ms / 86400000.0) + update_date: + value: update_date_days + (update_date_ms / 86400000.0) + unknown_repeating: + seq: + - id: unknown_repeating1 + type: f8 + - id: unknown_repeating2 + type: f8 + - id: unknown_repeating3 + type: f8 + - id: unknown_repeating4 + type: f8 + - id: unknown_repeating5 + type: f8 + - id: unknown_repeating6 + type: f8 + - id: unknown_repeating7 + type: f8 + - id: unknown_repeating8 + type: f8 + - id: unknown_repeating9 + type: f8 + - id: unknown_repeating10 + type: f8 + - id: unknown_repeating11 + type: f8 + - id: unknown_repeating12 + type: f8 + - id: unknown_repeating13 + type: f8 + - id: unknown_repeating14 + type: f8 + - id: unknown_repeating15 + type: f8 + - id: unknown_repeating16 + type: f8 + - id: unknown_repeating17 + type: f8 + - id: unknown_repeating18 + type: f8 + entity: + seq: + - id: entity_type + type: s1 + enum: entities + - id: data + type: + switch-on: entity_type + cases: + 'entities::arc': entity_arc + 'entities::attdef': entity_attdef + 'entities::attrib': entity_attrib + 'entities::block_begin': entity_block_begin + 'entities::block_end': entity_block_end + 'entities::insert' : entity_insert + 'entities::circle': entity_circle + 'entities::dim': entity_dim + 'entities::face3d': entity_face3d + 'entities::line': entity_line + 'entities::line3d': entity_line3d + 'entities::point': entity_point + 'entities::polyline': entity_polyline + 'entities::polyline2': entity_polyline + 'entities::seqend': entity_seqend + 'entities::shape': entity_shape + 'entities::solid': entity_solid + 'entities::text': entity_text + 'entities::trace': entity_trace + 'entities::vertex': entity_vertex + _: entity_tmp + entity_mode: + seq: + - id: entity_mode1 + type: b1 + - id: entity_mode2 + type: b1 + - id: entity_mode3 + type: b1 + - id: entity_mode4 + type: b1 + - id: entity_thickness_flag + type: b1 + - id: entity_elevation_flag + type: b1 + - id: entity_linetype_flag + type: b1 + - id: entity_color_flag + type: b1 + entity_common: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: entity_layer_index + type: s1 + - id: flag1 + type: s1 + - id: flag2_1 + type: b1 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_6 + type: b1 + - id: flag2_7 + type: b1 + - id: flag2_8 + type: b1 + - id: flag3_1 + type: b1 + - id: flag3_2 + type: b1 + - id: flag3_3 + type: b1 + - id: flag3_4 + type: b1 + - id: flag3_5 + type: b1 + - id: flag3_6 + type: b1 + - id: flag3_7 + type: b1 + - id: flag3_8 + type: b1 + - id: entity_color + type: s1 + if: entity_mode.entity_color_flag + - id: entity_linetype_index + type: s1 + if: entity_mode.entity_linetype_flag + - id: entity_elevation + type: f8 + if: entity_mode.entity_elevation_flag + - id: entity_thickness + type: f8 + if: entity_mode.entity_thickness_flag + entity_arc: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: ARC/10 + - id: y + type: f8 + doc: ARC/20 + - id: radius + type: f8 + doc: ARC/40 + - id: angle_from + type: f8 + doc: ARC/50 + - id: angle_to + type: f8 + doc: ARC/51 + entity_attdef: + seq: + - id: entity_common + type: entity_common + - id: start_point + type: point_2d + doc: ATTDEF/10|20 + - id: height + type: f8 + doc: ATTDEF/40 + - id: default_size + type: s2 + - id: default + size: default_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/1 + - id: prompt_size + type: s2 + - id: prompt + size: prompt_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/3 + - id: tag_size + type: s2 + - id: tag + size: tag_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/2 + - id: flags + type: attdef_flags + doc: ATTDEF/70 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_7 + doc: ATTDEF/50 + - id: width_scale_factor + type: f8 + if: entity_common.flag2_6 + doc: ATTDEF/41 + - id: unknown_index + type: u1 + if: entity_common.flag2_4 + - id: flags2 + type: attdef_flags2 + if: entity_common.flag2_2 + doc: ATTDEF/72 + - id: end_point + type: point_2d + if: entity_common.flag2_1 + doc: ATTDEF/11|21 + entity_attrib: + seq: + - id: entity_common + type: entity_common + - id: u1 + type: f8 + - id: u2 + type: f8 + - id: u3 + type: f8 + - id: size + type: s2 + - id: text + size: size + - id: size2 + type: s2 + - id: text2 + size: size2 + - id: u4 + size: 1 + - id: u5 + type: f8 + if: entity_common.flag2_7 + - id: u6 + type: u1 + if: entity_common.flag2_2 + # 1, 2 nebo 7? + - id: u7 + type: f8 + if: entity_common.flag2_1 + - id: u8 + type: f8 + if: entity_common.flag2_1 + entity_block_begin: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + entity_block_end: + seq: + - id: entity_common + type: entity_common + entity_insert: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + doc: INSERT/2 + - id: x + type: f8 + doc: INSERT/10 + - id: y + type: f8 + doc: INSERT/20 + - id: x_scale + type: f8 + if: entity_common.flag2_8 + doc: INSERT/41 + - id: y_scale + type: f8 + if: entity_common.flag2_7 + doc: INSERT/42 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_6 + doc: INSERT/50 + - id: z_scale + type: f8 + if: entity_common.flag2_5 + doc: INSERT/43 + - id: columns + type: u2 + if: entity_common.flag2_4 + doc: INSERT/70 + - id: rows + type: u2 + if: entity_common.flag2_3 + doc: INSERT/71 + - id: column_spacing + type: f8 + if: entity_common.flag2_2 + doc: INSERT/44 + - id: row_spacing + type: f8 + if: entity_common.flag2_1 + doc: INSERT/45 + entity_circle: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: CIRCLE/10 + - id: y + type: f8 + doc: CIRCLE/20 + - id: radius + type: f8 + doc: CIRCLE/40 + entity_dim: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + - id: dimension_line_defining_point + type: point_2d + doc: DIMENSION/10|20 + - id: default_text_position + type: point_2d + doc: DIMENSION/11|21 + - id: unknown1 + type: u1 + if: entity_common.flag2_7 + doc: DIMENSION/70 + - id: text_size + type: s2 + if: entity_common.flag2_6 + - id: text + size: text_size + if: entity_common.flag2_6 + doc: DIMENSION/1 + - id: extension_defining_point1 + type: point_2d + if: entity_common.flag2_5 + doc: DIMENSION/13|23 + - id: extension_defining_point2 + type: point_2d + if: entity_common.flag2_4 + doc: DIMENSION/14|24 + - id: defining_point + type: point_2d + if: entity_common.flag2_3 + doc: DIMENSION/15|25 + - id: dimension_line_arc_definition_point + type: point_2d + if: entity_common.flag2_2 + - id: rotation_in_radians + type: f8 + if: entity_common.flag3_8 + entity_face3d: + seq: + - id: entity_common + type: entity_common + entity_line: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: LINE/10 + - id: y1 + type: f8 + doc: LINE/20 + - id: x2 + type: f8 + doc: LINE/11 + - id: y2 + type: f8 + doc: LINE/21 + entity_line3d: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: 3DLINE/10 + - id: y1 + type: f8 + doc: 3DLINE/20 + - id: z1 + type: f8 + if: entity_common.flag2_8 + doc: 3DLINE/30 + - id: x2 + type: f8 + doc: 3DLINE/11 + - id: y2 + type: f8 + doc: 3DLINE/21 + - id: z2 + type: f8 + if: entity_common.flag2_7 + doc: 3DLINE/31 + entity_tmp: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: xxx + size: entity_size - 4 + entity_point: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: POINT/10 + - id: y + type: f8 + doc: POINT/20 + entity_polyline: + seq: + - id: entity_common + type: entity_common + - id: closed + type: u1 + if: entity_common.flag2_8 + doc: POLYLINE/66 + - id: x + type: f8 + if: entity_common.flag2_7 + doc: POLYLINE/40 + - id: y + type: f8 + if: entity_common.flag2_6 + doc: POLYLINE/41 + entity_seqend: + seq: + - id: entity_common + type: entity_common + - id: unknown + size: 4 + entity_shape: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: item_num + type: u1 + - id: angle + type: f8 + if: entity_common.flag2_8 + - id: load_num + type: u1 + entity_solid: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_text: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: TEXT/10 + - id: y + type: f8 + doc: TEXT/20 + - id: height + type: f8 + doc: TEXT/40 + - id: size + type: s2 + - id: value + size: size + type: str + encoding: ASCII + terminator: 0x00 + doc: TEXT/1 + - id: angle + type: f8 + if: entity_common.flag2_8 + doc: TEXT/50 + - id: width_factor + type: f8 + if: entity_common.flag2_7 + doc: TEXT/41 + - id: obliquing_angle + type: f8 + if: entity_common.flag2_6 + doc: TEXT/51 + - id: style_index + type: u1 + if: entity_common.flag2_5 + doc: TEXT/7 + - id: generation + type: generation_flags + if: entity_common.flag2_4 + doc: TEXT/71 + - id: type + enum: text_type + type: u1 + if: entity_common.flag2_3 + doc: TEXT/72 + - id: aligned_to + type: point_2d + if: entity_common.flag2_2 + doc: TEXT/11|21 + entity_trace: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_vertex: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: VERTEX/10 + - id: y + type: f8 + doc: VERTEX/20 + - id: width + type: f8 + if: entity_common.flag2_8 + - id: bulge + type: f8 + if: entity_common.flag2_6 + doc: VERTEX/42 + - id: unknown_in_radians + type: f8 + if: entity_common.flag2_4 + doc: VERTEX/50 + attdef_flags: + seq: + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: invisible + type: b1 + - id: constant + type: b1 + - id: verify + type: b1 + attdef_flags2: + seq: +## TODO Tohle je divne + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: middle + type: b1 + - id: right + type: b1 + - id: center + type: b1 + layer: + seq: + - id: flag + type: layer_flag + doc: LAYER/70 + - id: layer_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LAYER/2 + - id: color + type: s2 + doc: LAYER/62 + - id: linetype_index + type: u2 + doc: LAYER/6 + - id: u1 + type: s1 + layer_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + linetype: + seq: + - id: flag + type: linetype_flag + doc: LTYPE/70 + - id: linetype_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/2 + - id: description + size: 48 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/3 + - id: alignment + type: u1 + doc: LTYPE/72 + - id: num_dashes + type: u1 + doc: LTYPE/73 + - id: pattern_len + type: f8 + doc: LTYPE/40 + - id: pattern + type: pattern + doc: LTYPE/49 + - id: unknown + type: s1 + pattern: + seq: + - id: pattern1 + type: f8 + - id: pattern2 + type: f8 + - id: pattern3 + type: f8 + - id: pattern4 + type: f8 + - id: pattern5 + type: f8 + - id: pattern6 + type: f8 + - id: pattern7 + type: f8 + - id: pattern8 + type: f8 + - id: pattern9 + type: f8 + - id: pattern10 + type: f8 + - id: pattern11 + type: f8 + - id: pattern12 + type: f8 + linetype_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + real_entities: + seq: + - id: entities + type: entity + repeat: eos + style: + seq: + - id: flag + type: style_flag + doc: STYLE/70 + - id: style_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/2 + - id: height + type: f8 + doc: STYLE/40 + - id: width_factor + type: f8 + doc: STYLE/41 + - id: obliquing_angle_in_radians + type: f8 + doc: STYLE/50 + - id: generation + type: generation_flags + doc: STYLE/71 + - id: last_height + type: f8 + doc: STYLE/42 + - id: font_file + size: 64 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/3 + - id: u1 + size: 64 + style_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: vertical + type: b1 + - id: flag7 + type: b1 + - id: load + type: b1 + view: + seq: + - id: flag + type: view_flag + doc: VIEW/70 + - id: view_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + - id: view_size + type: f8 + doc: VIEW/40 + - id: center_point + type: point_2d + doc: VIEW/10|20 + - id: view_width + type: f8 + doc: VIEW/41 + - id: view_dir + type: point_3d + doc: VIEW/11|21|31 + - id: u2a + size: 3 + view_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + generation_flags: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: upside_down + type: b1 + - id: backwards + type: b1 + - id: flag8 + type: b1 + point_2d: + seq: + - id: x + type: f8 + - id: y + type: f8 + point_3d: + seq: + - id: x + type: f8 + - id: y + type: f8 + - id: z + type: f8 +enums: + entities: + 1: line + 2: point + 3: circle + 4: shape + # NOT_USED 5: repeat_begin + # NOT_USED 6: repeat_end + 7: text + 8: arc + 9: trace + # NOT_USED 10: load + 11: solid + 12: block_begin + 13: block_end + 14: insert + 15: attdef + 16: attrib + 17: seqend + 18: polyline + 19: polyline2 + 20: vertex + 21: line3d + 22: face3d + 23: dim + osnap_modes: + 0: none + 1: endpoint + 2: midpoint + 4: center + 8: node + 16: quadrant + 32: intersection + 64: insertion + 128: perpendicular + 256: tangent + 512: nearest + unit_types: + 1: scientific + 2: decimal + 3: engineering + 4: architectural + 5: fractional + units_for_angles: + 0: decimal_degrees + 1: degrees_minutes_seconds + 2: gradians + 3: radians + 4: surveyor_s_units + angle_direction: + 0: counterclockwise + 1: clockwise + limits_check: + 0: objects_can_outside_grid + 1: objects_cannot_outside_grid + coordinates: + 0: absolute_coordinates + 1: absolute_coordinates_realtime + 2: relative_polar_coordinates + attributes: + 0: off + 1: normal + 2: on + current_color: + 0: byblock + 1: red + 2: yellow + 3: green + 4: cyan + 5: blue + 6: magenta + 7: white + 256: bylayer + iso_plane: + 0: left + 1: top + 2: right + text_type: + 1: center + 2: end + 3: aligned diff --git a/dwg_ac1002.ksy b/dwg_ac1002.ksy new file mode 100644 index 0000000..20ad3c1 --- /dev/null +++ b/dwg_ac1002.ksy @@ -0,0 +1,1425 @@ +meta: + id: dwg_ac1002 + title: AutoCAD drawing (AC1002) + application: AutoCAD + file-extension: + - dwg + license: CC0-1.0 + xref: + justsolve: DWG + pronom: + fmt: 28 + mime: + - application/x-dwg + - image/vnd.dwg + wikidata: Q27863119 + endian: le +seq: + - id: header + type: header + - id: entities + type: real_entities + size: header.entities_end - header.entities_start + - id: blocks + type: block + repeat: expr + repeat-expr: header.table_block.items + - id: layers + type: layer + repeat: expr + repeat-expr: header.table_layer.items + - id: styles + type: style + repeat: expr + repeat-expr: header.table_style.items + - id: linetypes + type: linetype + repeat: expr + repeat-expr: header.table_linetype.items + - id: views + type: view + repeat: expr + repeat-expr: header.table_view.items + - id: block_entities + type: real_entities + size: header.blocks_size + - id: todo + size-eos: true + repeat: eos + if: not _io.eof +types: + block: + seq: + - id: flag + type: block_flag + doc: BLOCK/70 + - id: block_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: BLOCK/2 + - id: u2 + type: s1 + - id: u3 + type: s1 + - id: u4 + type: s1 + - id: u5 + type: s1 + - id: u6 + type: s1 + block_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + header: + seq: + - id: magic + contents: [0x41, 0x43, 0x31, 0x30, 0x30, 0x32] + doc: 0x0000-0x0005, $ACADVER + - id: zeros + size: 6 + - id: zero_one_or_three + type: s1 + - id: unknown_3 + type: s2 + - id: num_sections + type: s2 + - id: num_header_vars + type: s2 + - id: dwg_version + type: s1 + - id: entities_start + type: s4 + - id: entities_end + type: s4 + - id: blocks_start + type: s4 + - id: blocks_size_raw + type: s2 + - id: unknown4a + size: 2 + - id: blocks_end + type: s4 + - id: unknown4b + size: 2 + - id: unknown4c + size: 2 + - id: table_block + type: table + - id: table_layer + type: table + - id: table_style + type: table + - id: table_linetype + type: table + - id: table_view + type: table + - id: variables + type: header_variables + instances: + blocks_size_unknown: + value: (blocks_size_raw & 0xff000000) >> 24 + blocks_size: + value: (blocks_size_raw & 0x00ffffff) + table: + seq: + - id: item_size + type: u2 + - id: items + type: u2 + - id: unknown + size: 2 + - id: begin + type: u4 + header_variables: + seq: + - id: insertion_base + type: point_3d + doc: 0x005e-0x0075, $INSBASE/10|20|30 + - id: num_entities + type: u2 + doc: 0x0076-0x0077 + - id: drawing_first + type: point_3d + doc: 0x0078-0x008f, $EXTMIN/10|20|30 + - id: drawing_second + type: point_3d + doc: 0x0090-0x00a7, $EXTMAX/10|20|30 + - id: limits_min + type: point_2d + doc: 0x00a8-0x00b7, $LIMMIN/10|20 + - id: limits_max + type: point_2d + doc: 0x00b8-0x00c7, $LIMMAX/10|20 + - id: view_ctrl + type: point_3d + doc: 0x00c8-0x00da, $VIEWCTRL/10|20|30 + - id: view_size + type: f8 + doc: 0x00e0-0x00e7 + - id: snap + type: s2 + doc: 0x00e8-0x00e9, $SNAPMODE + - id: snap_resolution + type: point_2d + doc: 0x00ea-0x00f9, $SNAPUNIT/10|20 + - id: snap_base + type: point_2d + doc: 0x00fa-0x0109, $SNAPBASE/10|20 + - id: snap_angle + type: f8 + doc: 0x010a-0x0111, $SNAPANG + - id: snap_style + type: s2 + doc: 0x0112-0x0113, $SNAPSTYLE + - id: snap_iso_pair + type: s2 + enum: iso_plane + doc: 0x0114-0x0115, $SNAPISOPAIR + - id: grid + type: s2 + doc: 0x0116-0x0117, $GRIDMODE + - id: grid_unit + type: point_2d + doc: 0x0118-0x0127, $GRIDUNIT/10|20 + - id: ortho + type: s2 + doc: 0x0128-0x0129, $ORTHOMODE + - id: regen + type: s2 + doc: 0x012a-0x012b, $REGENMODE + - id: fill + type: s2 + doc: 0x012c-0x012d, $FILLMODE + - id: qtext + type: s2 + doc: 0x012e-0x012f, $QTEXTMODE + - id: drag + type: s2 + doc: 0x0130-0x0131, $DRAGMODE + - id: linetype_scale + type: f8 + doc: 0x0132-0x0139, $LTSCALE + - id: text_size + type: f8 + doc: 0x013a-0x0141, $TEXTSIZE + - id: trace_width + type: f8 + doc: 0x0142-0x0149, $TRACEWID + - id: current_layer_index + type: s2 + doc: 0x014a-0x014b, $CLAYER + - id: current_color_convert + type: s2 + doc: 0x014c-0x014d, (2, 3, 8, 15 - default) + - id: unknown6 + type: f8 + doc: 0x014e-0x0155 + - id: unknown7a + type: s2 + doc: 0x0156-0x0157 + - id: unknown7b + type: s2 + doc: 0x0158-0x0159 + - id: unknown7c + type: s2 + doc: 0x015a-0x015b + - id: unknown8 + type: f8 + doc: 0x015c-0x0163 + - id: linear_units_format + enum: unit_types + type: s2 + doc: 0x0164-0x0165, $LUNITS + - id: linear_units_precision + type: s2 + doc: 0x0166-0x0167, $LUPREC + - id: axis + type: s2 + doc: 0x0168-0x0169, $AXISMODE + - id: axis_value + type: point_2d + doc: 0x016a-0x0179, $AXISUNIT/10|20 + - id: sketch_increment + type: f8 + doc: 0x017a-0x0181, $SKETCHINC + - id: fillet_radius + type: f8 + doc: $FILLETRAD + - id: units_for_angles + enum: units_for_angles + type: s2 + doc: $AUNITS + - id: angular_precision + type: s2 + doc: $AUPREC + - id: text_style_index + type: s2 + doc: 0x018e-0x018f, $TEXTSTYLE (index) + - id: osnap + enum: osnap_modes + type: s2 + doc: 0x0190-0x0191, $OSMODE + - id: attributes + enum: attributes + type: s2 + doc: 0x0192-0x0193, $ATTMODE + - id: menu + size: 15 + type: str + encoding: ASCII + terminator: 0x00 + doc: 0x0194-0x01a2, $MENU + - id: dim_scale + type: f8 + doc: 0x01a3-0x01aa, $DIMSCALE + - id: dim_arrowhead_size + type: f8 + doc: $DIMASZ + - id: dim_extension_line_offset + type: f8 + doc: $DIMEXO + - id: dim_baseline_spacing + type: f8 + doc: $DIMDLI + - id: dim_extension_line_extend + type: f8 + doc: $DIMEXE + - id: dim_maximum_tolerance_limit + type: f8 + doc: 0x01cb-0x01d2, $DIMTP + - id: dim_minimum_tolerance_limit + type: f8 + doc: 0x01d3-0x01da, $DIMTM + - id: dim_text_height + type: f8 + doc: 0x01db-0x01e2, $DIMTXT + - id: dim_center_mark_control + type: f8 + doc: 0x01e3-0x01ea, $DIMCEN + - id: dim_oblique_stroke_size + type: f8 + doc: 0x01eb-0x01f2, $DIMTSZ + - id: dim_tolerances + type: s1 + doc: 0x01f3, $DIMTOL + - id: dim_limits_default_text + type: s1 + doc: 0x01f4, $DIMLIM + - id: dim_text_ext_inside_line_position + type: s1 + doc: 0x01f5, $DIMTIH + - id: dim_text_ext_outside_line_position + type: s1 + doc: 0x01f6, $DIMTOH + - id: dim_extension_line_first_suppress + type: s1 + doc: 0x01f7, $DIMSE1 + - id: dim_extension_line_second_suppress + type: s1 + doc: 0x01f8, $DIMSE2 + - id: dim_text_vertical_position + type: s1 + doc: 0x01f9, $DIMTAD + - id: limits_check + enum: limits_check + type: s2 + doc: 0x01fa-0x01fb, $LIMCHECK + - id: unknown10 + size: 45 + - id: elevation + type: f8 + doc: 0x0229-0x0230, $ELEVATION + - id: thickness + type: f8 + doc: 0x0231-0x0238, $THICKNESS + - id: view_point + type: point_3d + doc: 0x0239-0x0251, $VIEWDIR/10|20|30 + - id: unknown_repeating + type: unknown_repeating + doc: 0x0252-0x02e0 + - id: unknown29 + type: s2 + doc: 0x02e1-0x02e2 + - id: blip + type: s2 + doc: 0x02e3-0x02e4, $BLIPMODE + - id: dim_suppression_of_zeros + type: s1 + doc: 0x02e5, $DIMZIN + - id: dim_rounding + type: f8 + doc: 0x02e6-0x02ed, $DIMRND + - id: dim_extension_line_extend2 + type: f8 + doc: 0x02ee-0x02f5, $DIMDLE + - id: dim_arrowhead_block + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMBLK + - id: unknown30 + type: s1 + - id: circle_zoom_percent + type: s2 + doc: 0x0317-0x0318 + - id: coordinates + enum: coordinates + type: s2 + doc: 0x0319-0x031a, $COORDS + - id: current_color + enum: current_color + type: s2 + doc: 256d - bylayer, 0d - byblock, other index (1-255), $CECOLOR + - id: current_linetype + type: s2 + doc: 256d - bylayer, 255d - byblock, other index, $CELTYPE + - id: create_date_days + type: u4 + doc: $TDCREATE/days + - id: create_date_ms + type: u4 + doc: $TDCREATE/ms + - id: update_date_days + type: u4 + doc: $TDUPDATE/days + - id: update_date_ms + type: u4 + doc: $TDUPDATE/ms + - id: total_editing_time_days + type: u4 + doc: $TDINDWG/days + - id: total_editing_time_ms + type: u4 + doc: $TDINDWG/ms + - id: user_elapsed_timer_days + type: u4 + doc: $TDUSRTIMER/days + - id: user_elapsed_timer_ms + type: u4 + doc: $TDUSRTIMER/ms + - id: user_timer + type: s2 + doc: 0x033f-0x0340, $USRTIMER + - id: fast_zoom + type: s1 + doc: 0x0341, $FASTZOOM + - id: unknown33 + size: 1 + - id: sketch_type + type: s1 + doc: 0x0343, $SKPOLY + - id: unknown33b + size: 7 + - id: unknown34 + type: f8 + - id: angle_base + type: f8 + doc: 0x0353-0x035a, $ANGBASE + - id: angle_direction + enum: angle_direction + type: s2 + doc: 0x035b-0x035c, $ANGDIR + - id: point_mode + type: s2 + doc: 0x035d-0x035e, $PDMODE + - id: point_size + type: f8 + doc: $PDSIZE + - id: polyline_width + type: f8 + doc: $PLINEWID + - id: user_integer_1 + type: s2 + doc: 0x035f-0x0360, $USERI1 + if: _root.header.num_header_vars == 114 + - id: user_integer_2 + type: s2 + doc: 0x0361-0x0362, $USERI2 + if: _root.header.num_header_vars == 114 + - id: user_integer_3 + type: s2 + doc: 0x0363-0x0364, $USERI3 + if: _root.header.num_header_vars == 114 + - id: user_integer_4 + type: s2 + doc: 0x0365-0x0366, $USERI4 + if: _root.header.num_header_vars == 114 + - id: user_integer_5 + type: s2 + doc: 0x0367-0x0368, $USERI5 + if: _root.header.num_header_vars == 114 + - id: user_real_1 + type: f8 + doc: $USERR1 + if: _root.header.num_header_vars == 114 + - id: user_real_2 + type: f8 + doc: $USERR2 + if: _root.header.num_header_vars == 114 + - id: user_real_3 + type: f8 + doc: $USERR3 + if: _root.header.num_header_vars == 114 + - id: user_real_4 + type: f8 + doc: $USERR4 + if: _root.header.num_header_vars == 114 + - id: user_real_5 + type: f8 + doc: $USERR5 + if: _root.header.num_header_vars == 114 + instances: + create_date: + value: create_date_days + (create_date_ms / 86400000.0) + update_date: + value: update_date_days + (update_date_ms / 86400000.0) + unknown_repeating: + seq: + - id: unknown_repeating1 + type: f8 + - id: unknown_repeating2 + type: f8 + - id: unknown_repeating3 + type: f8 + - id: unknown_repeating4 + type: f8 + - id: unknown_repeating5 + type: f8 + - id: unknown_repeating6 + type: f8 + - id: unknown_repeating7 + type: f8 + - id: unknown_repeating8 + type: f8 + - id: unknown_repeating9 + type: f8 + - id: unknown_repeating10 + type: f8 + - id: unknown_repeating11 + type: f8 + - id: unknown_repeating12 + type: f8 + - id: unknown_repeating13 + type: f8 + - id: unknown_repeating14 + type: f8 + - id: unknown_repeating15 + type: f8 + - id: unknown_repeating16 + type: f8 + - id: unknown_repeating17 + type: f8 + - id: unknown_repeating18 + type: f8 + entity: + seq: + - id: entity_type + type: s1 + enum: entities + - id: data + type: + switch-on: entity_type + cases: + 'entities::arc': entity_arc + 'entities::attdef': entity_attdef + 'entities::attrib': entity_attrib + 'entities::block_begin': entity_block_begin + 'entities::block_end': entity_block_end + 'entities::insert' : entity_insert + 'entities::circle': entity_circle + 'entities::dim': entity_dim + 'entities::face3d': entity_face3d + 'entities::line': entity_line + 'entities::line3d': entity_line3d + 'entities::point': entity_point + 'entities::polyline': entity_polyline + 'entities::polyline2': entity_polyline + 'entities::seqend': entity_seqend + 'entities::shape': entity_shape + 'entities::solid': entity_solid + 'entities::text': entity_text + 'entities::trace': entity_trace + 'entities::vertex': entity_vertex + _: entity_tmp + entity_mode: + seq: + - id: entity_mode1 + type: b1 + - id: entity_mode2 + type: b1 + - id: entity_mode3 + type: b1 + - id: entity_mode4 + type: b1 + - id: entity_thickness_flag + type: b1 + - id: entity_elevation_flag + type: b1 + - id: entity_linetype_flag + type: b1 + - id: entity_color_flag + type: b1 + entity_common: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: entity_layer_index + type: s1 + - id: flag1 + type: s1 + - id: flag2_1 + type: b1 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_6 + type: b1 + - id: flag2_7 + type: b1 + - id: flag2_8 + type: b1 + - id: flag3_1 + type: b1 + - id: flag3_2 + type: b1 + - id: flag3_3 + type: b1 + - id: flag3_4 + type: b1 + - id: flag3_5 + type: b1 + - id: flag3_6 + type: b1 + - id: flag3_7 + type: b1 + - id: flag3_8 + type: b1 + - id: entity_color + type: s1 + if: entity_mode.entity_color_flag + - id: entity_linetype_index + type: s1 + if: entity_mode.entity_linetype_flag + - id: entity_elevation + type: f8 + if: entity_mode.entity_elevation_flag + - id: entity_thickness + type: f8 + if: entity_mode.entity_thickness_flag + entity_arc: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: ARC/10 + - id: y + type: f8 + doc: ARC/20 + - id: radius + type: f8 + doc: ARC/40 + - id: angle_from + type: f8 + doc: ARC/50 + - id: angle_to + type: f8 + doc: ARC/51 + entity_attdef: + seq: + - id: entity_common + type: entity_common + - id: start_point + type: point_2d + doc: ATTDEF/10|20 + - id: height + type: f8 + doc: ATTDEF/40 + - id: default_size + type: s2 + - id: default + size: default_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/1 + - id: prompt_size + type: s2 + - id: prompt + size: prompt_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/3 + - id: tag_size + type: s2 + - id: tag + size: tag_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/2 + - id: flags + type: attdef_flags + doc: ATTDEF/70 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_7 + doc: ATTDEF/50 + - id: width_scale_factor + type: f8 + if: entity_common.flag2_6 + doc: ATTDEF/41 + - id: unknown_index + type: u1 + if: entity_common.flag2_4 + - id: flags2 + type: attdef_flags2 + if: entity_common.flag2_2 + doc: ATTDEF/72 + - id: end_point + type: point_2d + if: entity_common.flag2_1 + doc: ATTDEF/11|21 + entity_attrib: + seq: + - id: entity_common + type: entity_common + - id: u1 + type: f8 + doc: ATTRIB/10 + - id: u2 + type: f8 + doc: ATTRIB/20 + - id: u3 + type: f8 + doc: ATRRIB/40 + - id: size + type: s2 + - id: text + size: size + doc: ATRRIB/1 + - id: size2 + type: s2 + - id: text2 + size: size2 + doc: ATRRIB/2 + - id: u4 + type: u1 + - id: u5 + type: f8 + if: entity_common.flag2_7 + doc: ATRRIB/50 + - id: u6 + type: u1 + if: entity_common.flag2_4 + - id: u7 + type: u1 + if: entity_common.flag2_2 + # 1, 2 nebo 7? + - id: aligned_to + type: point_2d + if: entity_common.flag2_1 + doc: ATTRIB/11|21 + entity_block_begin: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + entity_block_end: + seq: + - id: entity_common + type: entity_common + entity_insert: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + doc: INSERT/2 + - id: x + type: f8 + doc: INSERT/10 + - id: y + type: f8 + doc: INSERT/20 + - id: x_scale + type: f8 + if: entity_common.flag2_8 + doc: INSERT/41 + - id: y_scale + type: f8 + if: entity_common.flag2_7 + doc: INSERT/42 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_6 + doc: INSERT/50 + - id: z_scale + type: f8 + if: entity_common.flag2_5 + doc: INSERT/43 + - id: columns + type: u2 + if: entity_common.flag2_4 + doc: INSERT/70 + - id: rows + type: u2 + if: entity_common.flag2_3 + doc: INSERT/71 + - id: column_spacing + type: f8 + if: entity_common.flag2_2 + doc: INSERT/44 + - id: row_spacing + type: f8 + if: entity_common.flag2_1 + doc: INSERT/45 + entity_circle: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: CIRCLE/10 + - id: y + type: f8 + doc: CIRCLE/20 + - id: radius + type: f8 + doc: CIRCLE/40 + entity_dim: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + - id: dimension_line_defining_point + type: point_2d + doc: DIMENSION/10|20 + - id: default_text_position + type: point_2d + doc: DIMENSION/11|21 + - id: unknown1 + type: u1 + if: entity_common.flag2_7 + doc: DIMENSION/70 + - id: text_size + type: s2 + if: entity_common.flag2_6 + - id: text + size: text_size + if: entity_common.flag2_6 + doc: DIMENSION/1 + - id: extension_defining_point1 + type: point_2d + if: entity_common.flag2_5 + doc: DIMENSION/13|23 + - id: extension_defining_point2 + type: point_2d + if: entity_common.flag2_4 + doc: DIMENSION/14|24 + - id: defining_point + type: point_2d + if: entity_common.flag2_3 + doc: DIMENSION/15|25 + - id: dimension_line_arc_definition_point + type: point_2d + if: entity_common.flag2_2 + - id: rotation_in_radians + type: f8 + if: entity_common.flag3_8 + entity_face3d: + seq: + - id: entity_common + type: entity_common + entity_line: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: LINE/10 + - id: y1 + type: f8 + doc: LINE/20 + - id: x2 + type: f8 + doc: LINE/11 + - id: y2 + type: f8 + doc: LINE/21 + entity_line3d: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: 3DLINE/10 + - id: y1 + type: f8 + doc: 3DLINE/20 + - id: z1 + type: f8 + if: entity_common.flag2_8 + doc: 3DLINE/30 + - id: x2 + type: f8 + doc: 3DLINE/11 + - id: y2 + type: f8 + doc: 3DLINE/21 + - id: z2 + type: f8 + if: entity_common.flag2_7 + doc: 3DLINE/31 + entity_tmp: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: xxx + size: entity_size - 4 + entity_point: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: POINT/10 + - id: y + type: f8 + doc: POINT/20 + entity_polyline: + seq: + - id: entity_common + type: entity_common + - id: closed + type: u1 + if: entity_common.flag2_8 + doc: POLYLINE/66 + - id: x + type: f8 + if: entity_common.flag2_7 + doc: POLYLINE/40 + - id: y + type: f8 + if: entity_common.flag2_6 + doc: POLYLINE/41 + entity_seqend: + seq: + - id: entity_common + type: entity_common + - id: unknown + size: 4 + entity_shape: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: item_num + type: u1 + - id: angle + type: f8 + if: entity_common.flag2_8 + - id: load_num + type: u1 + entity_solid: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_text: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: TEXT/10 + - id: y + type: f8 + doc: TEXT/20 + - id: height + type: f8 + doc: TEXT/40 + - id: size + type: s2 + - id: value + size: size + type: str + encoding: ASCII + terminator: 0x00 + doc: TEXT/1 + - id: angle + type: f8 + if: entity_common.flag2_8 + doc: TEXT/50 + - id: width_factor + type: f8 + if: entity_common.flag2_7 + doc: TEXT/41 + - id: obliquing_angle + type: f8 + if: entity_common.flag2_6 + doc: TEXT/51 + - id: style_index + type: u1 + if: entity_common.flag2_5 + doc: TEXT/7 + - id: generation + type: generation_flags + if: entity_common.flag2_4 + doc: TEXT/71 + - id: type + enum: text_type + type: u1 + if: entity_common.flag2_3 + doc: TEXT/72 + - id: aligned_to + type: point_2d + if: entity_common.flag2_2 + doc: TEXT/11|21 + entity_trace: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_vertex: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: VERTEX/10 + - id: y + type: f8 + doc: VERTEX/20 + - id: width + type: f8 + if: entity_common.flag2_8 + - id: unknown1 + type: f8 + if: entity_common.flag2_7 + - id: bulge + type: f8 + if: entity_common.flag2_6 + doc: VERTEX/42 + - id: unknown2 + type: u1 + if: entity_common.flag2_5 + - id: unknown_in_radians + type: f8 + if: entity_common.flag2_4 + doc: VERTEX/50 + attdef_flags: + seq: + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: invisible + type: b1 + - id: constant + type: b1 + - id: verify + type: b1 + attdef_flags2: + seq: +## TODO Tohle je divne + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: middle + type: b1 + - id: right + type: b1 + - id: center + type: b1 + layer: + seq: + - id: flag + type: layer_flag + doc: LAYER/70 + - id: layer_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LAYER/2 + - id: color + type: s2 + doc: LAYER/62 + - id: linetype_index + type: u2 + doc: LAYER/6 + - id: u1 + type: s1 + layer_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + linetype: + seq: + - id: flag + type: linetype_flag + doc: LTYPE/70 + - id: linetype_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/2 + - id: description + size: 48 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/3 + - id: alignment + type: u1 + doc: LTYPE/72 + - id: num_dashes + type: u1 + doc: LTYPE/73 + - id: pattern_len + type: f8 + doc: LTYPE/40 + - id: pattern + type: pattern + doc: LTYPE/49 + - id: u21 + type: s1 + pattern: + seq: + - id: pattern1 + type: f8 + - id: pattern2 + type: f8 + - id: pattern3 + type: f8 + - id: pattern4 + type: f8 + - id: pattern5 + type: f8 + - id: pattern6 + type: f8 + - id: pattern7 + type: f8 + - id: pattern8 + type: f8 + - id: pattern9 + type: f8 + - id: pattern10 + type: f8 + - id: pattern11 + type: f8 + - id: pattern12 + type: f8 + linetype_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + real_entities: + seq: + - id: entities + type: entity + repeat: eos + style: + seq: + - id: flag + type: style_flag + doc: STYLE/70 + - id: style_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/2 + - id: height + type: f8 + doc: STYLE/40 + - id: width_factor + type: f8 + doc: STYLE/41 + - id: obliquing_angle_in_radians + type: f8 + doc: STYLE/50 + - id: generation + type: generation_flags + doc: STYLE/71 + - id: last_height + type: f8 + doc: STYLE/42 + - id: font_file + size: 64 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/3 + - id: u1 + size: 64 + style_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: vertical + type: b1 + - id: flag7 + type: b1 + - id: load + type: b1 + view: + seq: + - id: flag + type: view_flag + doc: VIEW/70 + - id: view_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + - id: view_size + type: f8 + doc: VIEW/40 + - id: center_point + type: point_2d + doc: VIEW/10|20 + - id: view_width + type: f8 + doc: VIEW/41 + - id: view_dir + type: point_3d + doc: VIEW/11|21|31 + - id: u3 + type: s2 + - id: u4 + type: u1 + view_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + generation_flags: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: upside_down + type: b1 + - id: backwards + type: b1 + - id: flag8 + type: b1 + point_2d: + seq: + - id: x + type: f8 + - id: y + type: f8 + point_3d: + seq: + - id: x + type: f8 + - id: y + type: f8 + - id: z + type: f8 +enums: + entities: + 1: line + 2: point + 3: circle + 4: shape + # NOT_USED 5: repeat_begin + # NOT_USED 6: repeat_end + 7: text + 8: arc + 9: trace + # NOT_USED 10: load + 11: solid + 12: block_begin + 13: block_end + 14: insert + 15: attdef + 16: attrib + 17: seqend + 18: polyline + 19: polyline2 + 20: vertex + 21: line3d + 22: face3d + 23: dim + osnap_modes: + 0: none + 1: endpoint + 2: midpoint + 4: center + 8: node + 16: quadrant + 32: intersection + 64: insertion + 128: perpendicular + 256: tangent + 512: nearest + unit_types: + 1: scientific + 2: decimal + 3: engineering + 4: architectural + 5: fractional + units_for_angles: + 0: decimal_degrees + 1: degrees_minutes_seconds + 2: gradians + 3: radians + 4: surveyor_s_units + angle_direction: + 0: counterclockwise + 1: clockwise + limits_check: + 0: objects_can_outside_grid + 1: objects_cannot_outside_grid + coordinates: + 0: absolute_coordinates + 1: absolute_coordinates_realtime + 2: relative_polar_coordinates + attributes: + 0: off + 1: normal + 2: on + current_color: + 0: byblock + 1: red + 2: yellow + 3: green + 4: cyan + 5: blue + 6: magenta + 7: white + 256: bylayer + iso_plane: + 0: left + 1: top + 2: right + text_type: + 1: center + 2: end + 3: aligned diff --git a/dwg_ac1003.ksy b/dwg_ac1003.ksy new file mode 100644 index 0000000..742893b --- /dev/null +++ b/dwg_ac1003.ksy @@ -0,0 +1,1475 @@ +meta: + id: dwg_ac1003 + title: AutoCAD drawing (AC1003) + application: AutoCAD + file-extension: + - dwg + license: CC0-1.0 + xref: + justsolve: DWG + pronom: + fmt: 29 + mime: + - application/x-dwg + - image/vnd.dwg + wikidata: Q27863121 + endian: le +seq: + - id: header + type: header + - id: entities + type: real_entities + size: header.entities_end - header.entities_start + - id: blocks + type: block + repeat: expr + repeat-expr: header.table_block.items + - id: layers + type: layer + repeat: expr + repeat-expr: header.table_layer.items + - id: styles + type: style + repeat: expr + repeat-expr: header.table_style.items + - id: linetypes + type: linetype + repeat: expr + repeat-expr: header.table_linetype.items + - id: views + type: view + repeat: expr + repeat-expr: header.table_view.items + - id: block_entities + type: real_entities + size: header.blocks_size + - id: todo + size-eos: true + repeat: eos + if: not _io.eof +types: + block: + seq: + - id: flag + type: block_flag + doc: BLOCK/70 + - id: block_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: BLOCK/2 + - id: u2 + type: s1 + - id: u3 + type: s1 + - id: u4 + type: s1 + - id: u5 + type: s1 + - id: u6 + type: s1 + block_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + header: + seq: + - id: magic + contents: [0x41, 0x43, 0x31, 0x30, 0x30, 0x33] + doc: 0x0000-0x0005, $ACADVER + - id: zeros + size: 6 + - id: zero_one_or_three + type: s1 + - id: unknown_3 + type: s2 + - id: num_sections + type: s2 + - id: num_header_vars + type: s2 + - id: dwg_version + type: s1 + - id: entities_start + type: s4 + - id: entities_end + type: s4 + - id: blocks_start + type: s4 + - id: blocks_size_raw + type: u4 + - id: blocks_end + type: s4 + - id: unknown4b + size: 2 + - id: unknown4c + size: 2 + - id: table_block + type: table + - id: table_layer + type: table + - id: table_style + type: table + - id: table_linetype + type: table + - id: table_view + type: table + - id: variables + type: header_variables + instances: + blocks_size_unknown: + value: (blocks_size_raw & 0xff000000) >> 24 + blocks_size: + value: (blocks_size_raw & 0x00ffffff) + table: + seq: + - id: item_size + type: u2 + - id: items + type: u2 + - id: unknown + size: 2 + - id: begin + type: u4 + header_variables: + seq: + - id: insertion_base + type: point_3d + doc: 0x005e-0x0075, $INSBASE/10|20|30 + - id: num_entities + type: u2 + doc: 0x0076-0x0077 + - id: drawing_first + type: point_3d + doc: 0x0078-0x008f, $EXTMIN/10|20|30 + - id: drawing_second + type: point_3d + doc: 0x0090-0x00a7, $EXTMAX/10|20|30 + - id: limits_min + type: point_2d + doc: 0x00a8-0x00b7, $LIMMIN/10|20 + - id: limits_max + type: point_2d + doc: 0x00b8-0x00c7, $LIMMAX/10|20 + - id: view_ctrl + type: point_3d + doc: 0x00c8-0x00da, $VIEWCTRL/10|20|30 + - id: view_size + type: f8 + doc: 0x00e0-0x00e7 + - id: snap + type: s2 + doc: 0x00e8-0x00e9, $SNAPMODE + - id: snap_resolution + type: point_2d + doc: 0x00ea-0x00f9, $SNAPUNIT/10|20 + - id: snap_base + type: point_2d + doc: 0x00fa-0x0109, $SNAPBASE/10|20 + - id: snap_angle + type: f8 + doc: 0x010a-0x0111, $SNAPANG + - id: snap_style + type: s2 + doc: 0x0112-0x0113, $SNAPSTYLE + - id: snap_iso_pair + type: s2 + enum: iso_plane + doc: 0x0114-0x0115, $SNAPISOPAIR + - id: grid + type: s2 + doc: 0x0116-0x0117, $GRIDMODE + - id: grid_unit + type: point_2d + doc: 0x0118-0x0127, $GRIDUNIT/10|20 + - id: ortho + type: s2 + doc: 0x0128-0x0129, $ORTHOMODE + - id: regen + type: s2 + doc: 0x012a-0x012b, $REGENMODE + - id: fill + type: s2 + doc: 0x012c-0x012d, $FILLMODE + - id: qtext + type: s2 + doc: 0x012e-0x012f, $QTEXTMODE + - id: drag + type: s2 + doc: 0x0130-0x0131, $DRAGMODE + - id: linetype_scale + type: f8 + doc: 0x0132-0x0139, $LTSCALE + - id: text_size + type: f8 + doc: 0x013a-0x0141, $TEXTSIZE + - id: trace_width + type: f8 + doc: 0x0142-0x0149, $TRACEWID + - id: current_layer_index + type: s2 + doc: 0x014a-0x014b, $CLAYER + - id: current_color_convert + type: f8 + doc: 0x014c-0x0153 + - id: unknown7a + size: 2 + doc: 0x0154-0x0155 + - id: unknown7b + size: 2 + doc: 0x0156-0x0157 + - id: unknown7c + size: 2 + doc: 0x0158-0x0159 + - id: unknown7d + size: 2 + doc: 0x015a-0x015b + - id: unknown8 + type: f8 + doc: 0x015c-0x0163 + - id: linear_units_format + enum: unit_types + type: s2 + doc: 0x0164-0x0165, $LUNITS + - id: linear_units_precision + type: s2 + doc: 0x0166-0x0167, $LUPREC + - id: axis + type: s2 + doc: 0x0168-0x0169, $AXISMODE + - id: axis_value + type: point_2d + doc: 0x016a-0x0179, $AXISUNIT/10|20 + - id: sketch_increment + type: f8 + doc: 0x017a-0x0181, $SKETCHINC + - id: fillet_radius + type: f8 + doc: $FILLETRAD + - id: units_for_angles + enum: units_for_angles + type: s2 + doc: $AUNITS + - id: angular_precision + type: s2 + doc: $AUPREC + - id: text_style_index + type: s2 + doc: 0x018e-0x018f, $TEXTSTYLE (index) + - id: osnap + enum: osnap_modes + type: s2 + doc: 0x0190-0x0191, $OSMODE + - id: attributes + enum: attributes + type: s2 + doc: 0x0192-0x0193, $ATTMODE + - id: menu + size: 15 + type: str + encoding: ASCII + terminator: 0x00 + doc: 0x0194-0x01a2, $MENU + - id: dim_scale + type: f8 + doc: 0x01a3-0x01aa, $DIMSCALE + - id: dim_arrowhead_size + type: f8 + doc: $DIMASZ + - id: dim_extension_line_offset + type: f8 + doc: $DIMEXO + - id: dim_baseline_spacing + type: f8 + doc: $DIMDLI + - id: dim_extension_line_extend + type: f8 + doc: $DIMEXE + - id: dim_maximum_tolerance_limit + type: f8 + doc: 0x01cb-0x01d2, $DIMTP + - id: dim_minimum_tolerance_limit + type: f8 + doc: 0x01d3-0x01da, $DIMTM + - id: dim_text_height + type: f8 + doc: 0x01db-0x01e2, $DIMTXT + - id: dim_center_mark_control + type: f8 + doc: 0x01e3-0x01ea, $DIMCEN + - id: dim_oblique_stroke_size + type: f8 + doc: 0x01eb-0x01f2, $DIMTSZ + - id: dim_tolerances + type: s1 + doc: 0x01f3, $DIMTOL + - id: dim_limits_default_text + type: s1 + doc: 0x01f4, $DIMLIM + - id: dim_text_ext_inside_line_position + type: s1 + doc: 0x01f5, $DIMTIH + - id: dim_text_ext_outside_line_position + type: s1 + doc: 0x01f6, $DIMTOH + - id: dim_extension_line_first_suppress + type: s1 + doc: 0x01f7, $DIMSE1 + - id: dim_extension_line_second_suppress + type: s1 + doc: 0x01f8, $DIMSE2 + - id: dim_text_vertical_position + type: s1 + doc: 0x01f9, $DIMTAD + - id: limits_check + enum: limits_check + type: s2 + doc: 0x01fa-0x01fb, $LIMCHECK + - id: unknown10 + size: 45 + - id: elevation + type: f8 + doc: 0x0229-0x0230, $ELEVATION + - id: thickness + type: f8 + doc: 0x0231-0x0238, $THICKNESS + - id: view_point + type: point_3d + doc: 0x0239-0x0251, $VIEWDIR/10|20|30 + - id: unknown_repeating + type: unknown_repeating + doc: 0x0252-0x02e0 + - id: unknown29 + type: s2 + doc: 0x02e1-0x02e2 + - id: blip + type: s2 + doc: 0x02e3-0x02e4, $BLIPMODE + - id: dim_suppression_of_zeros + type: s1 + doc: 0x02e5, $DIMZIN + - id: dim_rounding + type: f8 + doc: 0x02e6-0x02ed, $DIMRND + - id: dim_extension_line_extend2 + type: f8 + doc: 0x02ee-0x02f5, $DIMDLE + - id: dim_arrowhead_block + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMBLK + - id: unknown30 + type: s1 + - id: circle_zoom_percent + type: s2 + doc: 0x0317-0x0318 + - id: coordinates + enum: coordinates + type: s2 + doc: 0x0319-0x031a, $COORDS + - id: current_color + enum: current_color + type: s2 + doc: 256d - bylayer, 0d - byblock, other index (1-255), $CECOLOR + - id: current_linetype + type: s2 + doc: 256d - bylayer, 255d - byblock, other index, $CELTYPE + - id: create_date_days + type: u4 + doc: $TDCREATE/days + - id: create_date_ms + type: u4 + doc: $TDCREATE/ms + - id: update_date_days + type: u4 + doc: $TDUPDATE/days + - id: update_date_ms + type: u4 + doc: $TDUPDATE/ms + - id: total_editing_time_days + type: u4 + doc: $TDINDWG/days + - id: total_editing_time_ms + type: u4 + doc: $TDINDWG/ms + - id: user_elapsed_timer_days + type: u4 + doc: $TDUSRTIMER/days + - id: user_elapsed_timer_ms + type: u4 + doc: $TDUSRTIMER/ms + - id: user_timer + type: s2 + doc: 0x033f-0x0340, $USRTIMER + - id: fast_zoom + type: s1 + doc: 0x0341, $FASTZOOM + - id: unknown33 + size: 1 + - id: sketch_type + type: s1 + doc: 0x0343, $SKPOLY + - id: unknown33b + size: 7 + - id: unknown34 + type: f8 + - id: angle_base + type: f8 + doc: 0x0353-0x035a, $ANGBASE + - id: angle_direction + enum: angle_direction + type: s2 + doc: 0x035b-0x035c, $ANGDIR + - id: point_mode + type: s2 + doc: 0x035d-0x035e, $PDMODE + - id: point_size + type: f8 + doc: $PDSIZE + - id: polyline_width + type: f8 + doc: $PLINEWID + - id: user_integer_1 + type: s2 + doc: 0x035f-0x0360, $USERI1 + - id: user_integer_2 + type: s2 + doc: 0x0361-0x0362, $USERI2 + - id: user_integer_3 + type: s2 + doc: 0x0363-0x0364, $USERI3 + - id: user_integer_4 + type: s2 + doc: 0x0365-0x0366, $USERI4 + - id: user_integer_5 + type: s2 + doc: 0x0367-0x0368, $USERI5 + - id: user_real_1 + type: f8 + doc: $USERR1 + - id: user_real_2 + type: f8 + doc: $USERR2 + - id: user_real_3 + type: f8 + doc: $USERR3 + - id: user_real_4 + type: f8 + doc: $USERR4 + - id: user_real_5 + type: f8 + doc: $USERR5 + - id: dim_alternate_units + type: s1 + doc: 0x03a1, $DIMALT + - id: dim_alternate_units_decimal_places + type: s1 + doc: 0x03a2, $DIMALTD + - id: dim_associative + type: s1 + doc: 0x03a3, $DIMASO + - id: dim_sho + type: s1 + doc: 0x03a4, $DIMSHO + - id: dim_measurement_postfix + size: 16 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMPOST, TODO And prefix? + - id: dim_alternate_measurement_postfix + size: 16 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMAPOST, TODO And prefix + - id: dim_alternate_units_multiplier + type: f8 + doc: 0x03c5-0x03cc, $DIMALTF + if: _parent.num_header_vars == 122 + - id: dim_linear_measurements_scale_factor + type: f8 + doc: 0x03cd-0x03d4, $DIMLFAC + if: _parent.num_header_vars == 122 + instances: + create_date: + value: create_date_days + (create_date_ms / 86400000.0) + update_date: + value: update_date_days + (update_date_ms / 86400000.0) + unknown_repeating: + seq: + - id: unknown_repeating1 + type: f8 + - id: unknown_repeating2 + type: f8 + - id: unknown_repeating3 + type: f8 + - id: unknown_repeating4 + type: f8 + - id: unknown_repeating5 + type: f8 + - id: unknown_repeating6 + type: f8 + - id: unknown_repeating7 + type: f8 + - id: unknown_repeating8 + type: f8 + - id: unknown_repeating9 + type: f8 + - id: unknown_repeating10 + type: f8 + - id: unknown_repeating11 + type: f8 + - id: unknown_repeating12 + type: f8 + - id: unknown_repeating13 + type: f8 + - id: unknown_repeating14 + type: f8 + - id: unknown_repeating15 + type: f8 + - id: unknown_repeating16 + type: f8 + - id: unknown_repeating17 + type: f8 + - id: unknown_repeating18 + type: f8 + entity: + seq: + - id: entity_type + type: s1 + enum: entities + - id: data + type: + switch-on: entity_type + cases: + 'entities::arc': entity_arc + 'entities::attdef': entity_attdef + 'entities::attrib': entity_attrib + 'entities::block_begin': entity_block_begin + 'entities::block_end': entity_block_end + 'entities::insert' : entity_insert + 'entities::circle': entity_circle + 'entities::dim': entity_dim + 'entities::face3d': entity_face3d + 'entities::line': entity_line + 'entities::line3d': entity_line3d + 'entities::point': entity_point + 'entities::polyline': entity_polyline + 'entities::polyline2': entity_polyline + 'entities::seqend': entity_seqend + 'entities::shape': entity_shape + 'entities::solid': entity_solid + 'entities::text': entity_text + 'entities::trace': entity_trace + 'entities::vertex': entity_vertex + _: entity_tmp + entity_mode: + seq: + - id: entity_mode1 + type: b1 + - id: entity_mode2 + type: b1 + - id: entity_mode3 + type: b1 + - id: entity_mode4 + type: b1 + - id: entity_thickness_flag + type: b1 + - id: entity_elevation_flag + type: b1 + - id: entity_linetype_flag + type: b1 + - id: entity_color_flag + type: b1 + entity_common: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: entity_layer_index + type: s1 + - id: flag1 + type: s1 + - id: flag2_1 + type: b1 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_6 + type: b1 + - id: flag2_7 + type: b1 + - id: flag2_8 + type: b1 + - id: flag3_1 + type: b1 + - id: flag3_2 + type: b1 + - id: flag3_3 + type: b1 + - id: flag3_4 + type: b1 + - id: flag3_5 + type: b1 + - id: flag3_6 + type: b1 + - id: flag3_7 + type: b1 + - id: flag3_8 + type: b1 + - id: entity_color + type: s1 + if: entity_mode.entity_color_flag + - id: entity_linetype_index + type: s1 + if: entity_mode.entity_linetype_flag + - id: entity_elevation + type: f8 + if: entity_mode.entity_elevation_flag + - id: entity_thickness + type: f8 + if: entity_mode.entity_thickness_flag + entity_arc: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: ARC/10 + - id: y + type: f8 + doc: ARC/20 + - id: radius + type: f8 + doc: ARC/40 + - id: angle_from + type: f8 + doc: ARC/50 + - id: angle_to + type: f8 + doc: ARC/51 + entity_attdef: + seq: + - id: entity_common + type: entity_common + - id: start_point + type: point_2d + doc: ATTDEF/10|20 + - id: height + type: f8 + doc: ATTDEF/40 + - id: default_size + type: s2 + - id: default + size: default_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/1 + - id: prompt_size + type: s2 + - id: prompt + size: prompt_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/3 + - id: tag_size + type: s2 + - id: tag + size: tag_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/2 + - id: flags + type: attdef_flags + doc: ATTDEF/70 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_7 + doc: ATTDEF/50 + - id: width_scale_factor + type: f8 + if: entity_common.flag2_6 + doc: ATTDEF/41 + - id: unknown_index + type: u1 + if: entity_common.flag2_4 + - id: flags2 + type: attdef_flags2 + if: entity_common.flag2_2 + doc: ATTDEF/72 + - id: end_point + type: point_2d + if: entity_common.flag2_1 + doc: ATTDEF/11|21 + entity_attrib: + seq: + - id: entity_common + type: entity_common + - id: u1 + type: f8 + doc: ATTRIB/10 + - id: u2 + type: f8 + doc: ATTRIB/20 + - id: u3 + type: f8 + doc: ATRRIB/40 + - id: size + type: s2 + - id: text + size: size + doc: ATRRIB/1 + - id: size2 + type: s2 + - id: text2 + size: size2 + doc: ATRRIB/2 + - id: u4 + type: u1 + - id: u5 + type: f8 + if: entity_common.flag2_7 + doc: ATRRIB/50 + - id: u6 + type: u1 + if: entity_common.flag2_4 + - id: u7 + type: u1 + if: entity_common.flag2_2 + # 1, 2 nebo 7? + - id: aligned_to + type: point_2d + if: entity_common.flag2_1 + doc: ATTRIB/11|21 + entity_block_begin: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + entity_block_end: + seq: + - id: entity_common + type: entity_common + entity_insert: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + doc: INSERT/2 + - id: x + type: f8 + doc: INSERT/10 + - id: y + type: f8 + doc: INSERT/20 + - id: x_scale + type: f8 + if: entity_common.flag2_8 + doc: INSERT/41 + - id: y_scale + type: f8 + if: entity_common.flag2_7 + doc: INSERT/42 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_6 + doc: INSERT/50 + - id: z_scale + type: f8 + if: entity_common.flag2_5 + doc: INSERT/43 + - id: columns + type: u2 + if: entity_common.flag2_4 + doc: INSERT/70 + - id: rows + type: u2 + if: entity_common.flag2_3 + doc: INSERT/71 + - id: column_spacing + type: f8 + if: entity_common.flag2_2 + doc: INSERT/44 + - id: row_spacing + type: f8 + if: entity_common.flag2_1 + doc: INSERT/45 + entity_circle: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: CIRCLE/10 + - id: y + type: f8 + doc: CIRCLE/20 + - id: radius + type: f8 + doc: CIRCLE/40 + entity_dim: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + - id: dimension_line_defining_point + type: point_2d + doc: DIMENSION/10|20 + - id: default_text_position + type: point_2d + doc: DIMENSION/11|21 + - id: unknown1 + type: u1 + if: entity_common.flag2_7 + doc: DIMENSION/70 + - id: text_size + type: s2 + if: entity_common.flag2_6 + - id: text + size: text_size + if: entity_common.flag2_6 + doc: DIMENSION/1 + - id: extension_defining_point1 + type: point_2d + if: entity_common.flag2_5 + doc: DIMENSION/13|23 + - id: extension_defining_point2 + type: point_2d + if: entity_common.flag2_4 + doc: DIMENSION/14|24 + - id: defining_point + type: point_2d + if: entity_common.flag2_3 + doc: DIMENSION/15|25 + - id: dimension_line_arc_definition_point + type: point_2d + if: entity_common.flag2_2 + - id: rotation_in_radians + type: f8 + if: entity_common.flag3_8 + entity_face3d: + seq: + - id: entity_common + type: entity_common + - id: first_point_x + type: f8 + - id: first_point_y + type: f8 + - id: first_point_z + type: f8 + if: entity_common.flag2_8 + - id: second_point_x + type: f8 + - id: second_point_y + type: f8 + - id: second_point_z + type: f8 + if: entity_common.flag2_7 + - id: third_point_x + type: f8 + - id: third_point_y + type: f8 + - id: third_point_z + type: f8 + if: entity_common.flag2_6 + - id: fourth_point_x + type: f8 + - id: fourth_point_y + type: f8 + - id: fourth_point_z + type: f8 + if: entity_common.flag2_5 + entity_line: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: LINE/10 + - id: y1 + type: f8 + doc: LINE/20 + - id: x2 + type: f8 + doc: LINE/11 + - id: y2 + type: f8 + doc: LINE/21 + entity_line3d: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: 3DLINE/10 + - id: y1 + type: f8 + doc: 3DLINE/20 + - id: z1 + type: f8 + if: entity_common.flag2_8 + doc: 3DLINE/30 + - id: x2 + type: f8 + doc: 3DLINE/11 + - id: y2 + type: f8 + doc: 3DLINE/21 + - id: z2 + type: f8 + if: entity_common.flag2_7 + doc: 3DLINE/31 + entity_tmp: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: xxx + size: entity_size - 4 + entity_point: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: POINT/10 + - id: y + type: f8 + doc: POINT/20 + entity_polyline: + seq: + - id: entity_common + type: entity_common + - id: closed + type: u1 + if: entity_common.flag2_8 + doc: POLYLINE/66 + - id: x + type: f8 + if: entity_common.flag2_7 + doc: POLYLINE/40 + - id: y + type: f8 + if: entity_common.flag2_6 + doc: POLYLINE/41 + entity_seqend: + seq: + - id: entity_common + type: entity_common + - id: unknown + size: 4 + entity_shape: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: item_num + type: u1 + - id: angle + type: f8 + if: entity_common.flag2_8 + - id: load_num + type: u1 + entity_solid: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_text: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: TEXT/10 + - id: y + type: f8 + doc: TEXT/20 + - id: height + type: f8 + doc: TEXT/40 + - id: size + type: s2 + - id: value + size: size + type: str + encoding: ASCII + terminator: 0x00 + doc: TEXT/1 + - id: angle + type: f8 + if: entity_common.flag2_8 + doc: TEXT/50 + - id: width_factor + type: f8 + if: entity_common.flag2_7 + doc: TEXT/41 + - id: obliquing_angle + type: f8 + if: entity_common.flag2_6 + doc: TEXT/51 + - id: style_index + type: u1 + if: entity_common.flag2_5 + doc: TEXT/7 + - id: generation + type: generation_flags + if: entity_common.flag2_4 + doc: TEXT/71 + - id: type + enum: text_type + type: u1 + if: entity_common.flag2_3 + doc: TEXT/72 + - id: aligned_to + type: point_2d + if: entity_common.flag2_2 + doc: TEXT/11|21 + entity_trace: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_vertex: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: VERTEX/10 + - id: y + type: f8 + doc: VERTEX/20 + - id: width + type: f8 + if: entity_common.flag2_8 + - id: unknown1 + type: f8 + if: entity_common.flag2_7 + - id: bulge + type: f8 + if: entity_common.flag2_6 + doc: VERTEX/42 + - id: unknown2 + type: u1 + if: entity_common.flag2_5 + - id: unknown_in_radians + type: f8 + if: entity_common.flag2_4 + doc: VERTEX/50 + attdef_flags: + seq: + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: invisible + type: b1 + - id: constant + type: b1 + - id: verify + type: b1 + attdef_flags2: + seq: +## TODO Tohle je divne + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: middle + type: b1 + - id: right + type: b1 + - id: center + type: b1 + layer: + seq: + - id: flag + type: layer_flag + doc: LAYER/70 + - id: layer_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LAYER/2 + - id: color + type: s2 + doc: LAYER/62 + - id: linetype_index + type: u2 + doc: LAYER/6 + - id: u1 + type: s1 + layer_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + linetype: + seq: + - id: flag + type: linetype_flag + doc: LTYPE/70 + - id: linetype_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/2 + - id: description + size: 48 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/3 + - id: alignment + type: u1 + doc: LTYPE/72 + - id: num_dashes + type: u1 + doc: LTYPE/73 + - id: pattern_len + type: f8 + doc: LTYPE/40 + - id: pattern + type: pattern + doc: LTYPE/49 + - id: u21 + type: s1 + pattern: + seq: + - id: pattern1 + type: f8 + - id: pattern2 + type: f8 + - id: pattern3 + type: f8 + - id: pattern4 + type: f8 + - id: pattern5 + type: f8 + - id: pattern6 + type: f8 + - id: pattern7 + type: f8 + - id: pattern8 + type: f8 + - id: pattern9 + type: f8 + - id: pattern10 + type: f8 + - id: pattern11 + type: f8 + - id: pattern12 + type: f8 + linetype_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + real_entities: + seq: + - id: entities + type: entity + repeat: eos + style: + seq: + - id: flag + type: style_flag + doc: STYLE/70 + - id: style_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/2 + - id: height + type: f8 + doc: STYLE/40 + - id: width_factor + type: f8 + doc: STYLE/41 + - id: obliquing_angle_in_radians + type: f8 + doc: STYLE/50 + - id: generation + type: generation_flags + doc: STYLE/71 + - id: last_height + type: f8 + doc: STYLE/42 + - id: font_file + size: 64 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/3 + - id: u1 + size: 64 + style_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: vertical + type: b1 + - id: flag7 + type: b1 + - id: load + type: b1 + view: + seq: + - id: flag + type: view_flag + doc: VIEW/70 + - id: view_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + - id: view_size + type: f8 + doc: VIEW/40 + - id: center_point + type: point_2d + doc: VIEW/10|20 + - id: view_width + type: f8 + doc: VIEW/41 + - id: view_dir + type: point_3d + doc: VIEW/11|21|31 + - id: u3 + type: s2 + - id: u4 + type: u1 + view_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + generation_flags: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: upside_down + type: b1 + - id: backwards + type: b1 + - id: flag8 + type: b1 + point_2d: + seq: + - id: x + type: f8 + - id: y + type: f8 + point_3d: + seq: + - id: x + type: f8 + - id: y + type: f8 + - id: z + type: f8 +enums: + entities: + 1: line + 2: point + 3: circle + 4: shape + # NOT_USED 5: repeat_begin + # NOT_USED 6: repeat_end + 7: text + 8: arc + 9: trace + # NOT_USED 10: load + 11: solid + 12: block_begin + 13: block_end + 14: insert + 15: attdef + 16: attrib + 17: seqend + 18: polyline + 19: polyline2 + 20: vertex + 21: line3d + 22: face3d + 23: dim + osnap_modes: + 0: none + 1: endpoint + 2: midpoint + 4: center + 8: node + 16: quadrant + 32: intersection + 64: insertion + 128: perpendicular + 256: tangent + 512: nearest + unit_types: + 1: scientific + 2: decimal + 3: engineering + 4: architectural + 5: fractional + units_for_angles: + 0: decimal_degrees + 1: degrees_minutes_seconds + 2: gradians + 3: radians + 4: surveyor_s_units + angle_direction: + 0: counterclockwise + 1: clockwise + limits_check: + 0: objects_can_outside_grid + 1: objects_cannot_outside_grid + coordinates: + 0: absolute_coordinates + 1: absolute_coordinates_realtime + 2: relative_polar_coordinates + attributes: + 0: off + 1: normal + 2: on + current_color: + 0: byblock + 1: red + 2: yellow + 3: green + 4: cyan + 5: blue + 6: magenta + 7: white + 256: bylayer + iso_plane: + 0: left + 1: top + 2: right + text_type: + 1: center + 2: end + 3: aligned + 4: middle + 5: fit diff --git a/dwg_ac1004.ksy b/dwg_ac1004.ksy new file mode 100644 index 0000000..e20bb22 --- /dev/null +++ b/dwg_ac1004.ksy @@ -0,0 +1,1530 @@ +meta: + id: dwg_ac1004 + title: AutoCAD drawing (AC1004) + application: AutoCAD + file-extension: + - dwg + license: CC0-1.0 + xref: + justsolve: DWG + pronom: + fmt: 30 + mime: + - application/x-dwg + - image/vnd.dwg + wikidata: Q27863122 + endian: le +seq: + - id: header + type: header + - id: entities + type: real_entities + size: header.entities_end - header.entities_start + - id: blocks + type: block + repeat: expr + repeat-expr: header.table_block.items + - id: layers + type: layer + repeat: expr + repeat-expr: header.table_layer.items + - id: styles + type: style + repeat: expr + repeat-expr: header.table_style.items + - id: linetypes + type: linetype + repeat: expr + repeat-expr: header.table_linetype.items + - id: views + type: view + repeat: expr + repeat-expr: header.table_view.items + - id: block_entities + type: real_entities + size: header.blocks_size + - id: todo + size-eos: true + repeat: eos + if: not _io.eof +types: + block: + seq: + - id: flag + type: block_flag + doc: BLOCK/70 + - id: block_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: BLOCK/2 + - id: u2 + type: s1 + - id: u3 + type: s1 + - id: u4 + type: s1 + - id: u5 + type: s1 + block_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + header: + seq: + - id: magic + contents: [0x41, 0x43, 0x31, 0x30, 0x30, 0x34] + doc: 0x0000-0x0005, $ACADVER + - id: zeros + size: 6 + - id: zero_one_or_three + type: s1 + - id: unknown_3 + type: s2 + - id: num_sections + type: s2 + - id: num_header_vars + type: s2 + - id: dwg_version + type: s1 + - id: entities_start + type: s4 + - id: entities_end + type: s4 + - id: blocks_start + type: s4 + - id: blocks_size_raw + type: u4 + - id: blocks_end + type: s4 + - id: unknown4b + size: 2 + - id: unknown4c + size: 2 + - id: table_block + type: table + - id: table_layer + type: table + - id: table_style + type: table + - id: table_linetype + type: table + - id: table_view + type: table + - id: variables + type: header_variables + instances: + blocks_size_unknown: + value: (blocks_size_raw & 0xff000000) >> 24 + blocks_size: + value: (blocks_size_raw & 0x00ffffff) + table: + seq: + - id: item_size + type: u2 + - id: items + type: u2 + - id: unknown + size: 2 + - id: begin + type: u4 + header_variables: + seq: + - id: insertion_base + type: point_3d + doc: 0x005e-0x0075, $INSBASE/10|20|30 + - id: num_entities + type: u2 + doc: 0x0076-0x0077 + - id: drawing_first + type: point_3d + doc: 0x0078-0x008f, $EXTMIN/10|20|30 + - id: drawing_second + type: point_3d + doc: 0x0090-0x00a7, $EXTMAX/10|20|30 + - id: limits_min + type: point_2d + doc: 0x00a8-0x00b7, $LIMMIN/10|20 + - id: limits_max + type: point_2d + doc: 0x00b8-0x00c7, $LIMMAX/10|20 + - id: view_ctrl + type: point_3d + doc: 0x00c8-0x00da, $VIEWCTRL/10|20|30 + - id: view_size + type: f8 + doc: 0x00e0-0x00e7 + - id: snap + type: s2 + doc: 0x00e8-0x00e9, $SNAPMODE + - id: snap_resolution + type: point_2d + doc: 0x00ea-0x00f9, $SNAPUNIT/10|20 + - id: snap_base + type: point_2d + doc: 0x00fa-0x0109, $SNAPBASE/10|20 + - id: snap_angle + type: f8 + doc: 0x010a-0x0111, $SNAPANG + - id: snap_style + type: s2 + doc: 0x0112-0x0113, $SNAPSTYLE + - id: snap_iso_pair + type: s2 + enum: iso_plane + doc: 0x0114-0x0115, $SNAPISOPAIR + - id: grid + type: s2 + doc: 0x0116-0x0117, $GRIDMODE + - id: grid_unit + type: point_2d + doc: 0x0118-0x0127, $GRIDUNIT/10|20 + - id: ortho + type: s2 + doc: 0x0128-0x0129, $ORTHOMODE + - id: regen + type: s2 + doc: 0x012a-0x012b, $REGENMODE + - id: fill + type: s2 + doc: 0x012c-0x012d, $FILLMODE + - id: qtext + type: s2 + doc: 0x012e-0x012f, $QTEXTMODE + - id: drag + type: s2 + doc: 0x0130-0x0131, $DRAGMODE + - id: linetype_scale + type: f8 + doc: 0x0132-0x0139, $LTSCALE + - id: text_size + type: f8 + doc: 0x013a-0x0141, $TEXTSIZE + - id: trace_width + type: f8 + doc: 0x0142-0x0149, $TRACEWID + - id: current_layer_index + type: s2 + doc: 0x014a-0x014b, $CLAYER + - id: current_color_convert + type: f8 + doc: 0x014c-0x0153 + - id: unknown7a + size: 2 + doc: 0x0154-0x0155 + - id: unknown7b + size: 2 + doc: 0x0156-0x0157 + - id: unknown7c + size: 2 + doc: 0x0158-0x0159 + - id: unknown7d + size: 2 + doc: 0x015a-0x015b + - id: unknown8 + type: f8 + doc: 0x015c-0x0163 + - id: linear_units_format + enum: unit_types + type: s2 + doc: 0x0164-0x0165, $LUNITS + - id: linear_units_precision + type: s2 + doc: 0x0166-0x0167, $LUPREC + - id: axis + type: s2 + doc: 0x0168-0x0169, $AXISMODE/70 + - id: axis_value + type: point_2d + doc: 0x016a-0x0179, $AXISUNIT/10|20 + - id: sketch_increment + type: f8 + doc: 0x017a-0x0181, $SKETCHINC + - id: fillet_radius + type: f8 + doc: $FILLETRAD + - id: units_for_angles + enum: units_for_angles + type: s2 + doc: $AUNITS + - id: angular_precision + type: s2 + doc: $AUPREC + - id: text_style_index + type: s2 + doc: 0x018e-0x018f, $TEXTSTYLE (index) + - id: osnap + enum: osnap_modes + type: s2 + doc: 0x0190-0x0191, $OSMODE + - id: attributes + enum: attributes + type: s2 + doc: 0x0192-0x0193, $ATTMODE + - id: menu + size: 15 + type: str + encoding: ASCII + terminator: 0x00 + doc: 0x0194-0x01a2, $MENU + - id: dim_scale + type: f8 + doc: 0x01a3-0x01aa, $DIMSCALE + - id: dim_arrowhead_size + type: f8 + doc: $DIMASZ + - id: dim_extension_line_offset + type: f8 + doc: $DIMEXO + - id: dim_baseline_spacing + type: f8 + doc: $DIMDLI + - id: dim_extension_line_extend + type: f8 + doc: $DIMEXE + - id: dim_maximum_tolerance_limit + type: f8 + doc: 0x01cb-0x01d2, $DIMTP + - id: dim_minimum_tolerance_limit + type: f8 + doc: 0x01d3-0x01da, $DIMTM + - id: dim_text_height + type: f8 + doc: 0x01db-0x01e2, $DIMTXT + - id: dim_center_mark_control + type: f8 + doc: 0x01e3-0x01ea, $DIMCEN + - id: dim_oblique_stroke_size + type: f8 + doc: 0x01eb-0x01f2, $DIMTSZ + - id: dim_tolerances + type: s1 + doc: 0x01f3, $DIMTOL + - id: dim_limits_default_text + type: s1 + doc: 0x01f4, $DIMLIM + - id: dim_text_ext_inside_line_position + type: s1 + doc: 0x01f5, $DIMTIH + - id: dim_text_ext_outside_line_position + type: s1 + doc: 0x01f6, $DIMTOH + - id: dim_extension_line_first_suppress + type: s1 + doc: 0x01f7, $DIMSE1 + - id: dim_extension_line_second_suppress + type: s1 + doc: 0x01f8, $DIMSE2 + - id: dim_text_vertical_position + type: s1 + doc: 0x01f9, $DIMTAD + - id: limits_check + enum: limits_check + type: s2 + doc: 0x01fa-0x01fb, $LIMCHECK + - id: unknown10 + size: 45 + - id: elevation + type: f8 + doc: 0x0229-0x0230, $ELEVATION + - id: thickness + type: f8 + doc: 0x0231-0x0238, $THICKNESS + - id: view_point + type: point_3d + doc: 0x0239-0x0251, $VIEWDIR/10|20|30 + - id: unknown_repeating + type: unknown_repeating + doc: 0x0252-0x02e0 + - id: unknown29 + type: s2 + doc: 0x02e1-0x02e2 + - id: blip + type: s2 + doc: 0x02e3-0x02e4, $BLIPMODE + - id: dim_suppression_of_zeros + type: s1 + doc: 0x02e5, $DIMZIN + - id: dim_rounding + type: f8 + doc: 0x02e6-0x02ed, $DIMRND + - id: dim_extension_line_extend2 + type: f8 + doc: 0x02ee-0x02f5, $DIMDLE + - id: dim_arrowhead_block + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMBLK + - id: unknown30 + type: s1 + - id: circle_zoom_percent + type: s2 + doc: 0x0317-0x0318 + - id: coordinates + enum: coordinates + type: s2 + doc: 0x0319-0x031a, $COORDS + - id: current_color + enum: current_color + type: s2 + doc: 256d - bylayer, 0d - byblock, other index (1-255), $CECOLOR + - id: current_linetype + type: s2 + doc: 256d - bylayer, 255d - byblock, other index, $CELTYPE + - id: create_date_days + type: u4 + doc: $TDCREATE/days + - id: create_date_ms + type: u4 + doc: $TDCREATE/ms + - id: update_date_days + type: u4 + doc: $TDUPDATE/days + - id: update_date_ms + type: u4 + doc: $TDUPDATE/ms + - id: total_editing_time_days + type: u4 + doc: $TDINDWG/days + - id: total_editing_time_ms + type: u4 + doc: $TDINDWG/ms + - id: user_elapsed_timer_days + type: u4 + doc: $TDUSRTIMER/days + - id: user_elapsed_timer_ms + type: u4 + doc: $TDUSRTIMER/ms + - id: user_timer + type: s2 + doc: 0x033f-0x0340, $USRTIMER + - id: fast_zoom + type: u2 + doc: 0x0341, $FASTZOOM + - id: sketch_type + type: u2 + doc: 0x0343, $SKPOLY + - id: unknown33a + type: u2 + - id: unknown33b + type: u2 + - id: unknown33c + type: u2 + - id: unknown33d + type: u2 + - id: unknown33e + type: u2 + - id: unknown33f + type: u2 + - id: unknown33g + type: u2 + - id: angle_base + type: f8 + doc: 0x0353-0x035a, $ANGBASE + - id: angle_direction + enum: angle_direction + type: s2 + doc: 0x035b-0x035c, $ANGDIR + - id: point_mode + type: s2 + doc: 0x035d-0x035e, $PDMODE + - id: point_size + type: f8 + doc: $PDSIZE + - id: polyline_width + type: f8 + doc: $PLINEWID + - id: user_integer_1 + type: s2 + doc: 0x035f-0x0360, $USERI1 + - id: user_integer_2 + type: s2 + doc: 0x0361-0x0362, $USERI2 + - id: user_integer_3 + type: s2 + doc: 0x0363-0x0364, $USERI3 + - id: user_integer_4 + type: s2 + doc: 0x0365-0x0366, $USERI4 + - id: user_integer_5 + type: s2 + doc: 0x0367-0x0368, $USERI5 + - id: user_real_1 + type: f8 + doc: $USERR1 + - id: user_real_2 + type: f8 + doc: $USERR2 + - id: user_real_3 + type: f8 + doc: $USERR3 + - id: user_real_4 + type: f8 + doc: $USERR4 + - id: user_real_5 + type: f8 + doc: $USERR5 + - id: dim_alternate_units + type: s1 + doc: 0x03a1, $DIMALT + - id: dim_alternate_units_decimal_places + type: s1 + doc: 0x03a2, $DIMALTD + - id: dim_associative + type: s1 + doc: 0x03a3, $DIMASO + - id: dim_sho + type: s1 + doc: 0x03a4, $DIMSHO + - id: dim_measurement_postfix + size: 16 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMPOST, TODO And prefix? + - id: dim_alternate_measurement_postfix + size: 16 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMAPOST, TODO And prefix + - id: dim_alternate_units_multiplier + type: f8 + doc: 0x03c5-0x03cc, $DIMALTF + - id: dim_linear_measurements_scale_factor + type: f8 + doc: 0x03cd-0x03d4, $DIMLFAC + - id: spline_segs + type: s2 + doc: 0x03d5-0x03d6, $SPLINESEGS + - id: spline_frame + type: s2 + doc: 0x03d7-0x03d8, $SPLFRAME + - id: attreq + type: u2 + doc: 0x03d9-0x03da, $ATTREQ + - id: attdia + type: u2 + doc: 0x03db-0x03dc, $ATTDIA + - id: chamfera + type: f8 + doc: 0x03dd-0x04e4, $CHAMFERA/40 + - id: chamferb + type: f8 + doc: 0x04e5-0x04ec, $CHAMFERB/40 + - id: mirror_text + type: s2 + doc: 0x03ed-0x03ee, $MIRRTEXT + instances: + create_date: + value: create_date_days + (create_date_ms / 86400000.0) + update_date: + value: update_date_days + (update_date_ms / 86400000.0) + unknown_repeating: + seq: + - id: unknown_repeating1 + type: f8 + - id: unknown_repeating2 + type: f8 + - id: unknown_repeating3 + type: f8 + - id: unknown_repeating4 + type: f8 + - id: unknown_repeating5 + type: f8 + - id: unknown_repeating6 + type: f8 + - id: unknown_repeating7 + type: f8 + - id: unknown_repeating8 + type: f8 + - id: unknown_repeating9 + type: f8 + - id: unknown_repeating10 + type: f8 + - id: unknown_repeating11 + type: f8 + - id: unknown_repeating12 + type: f8 + - id: unknown_repeating13 + type: f8 + - id: unknown_repeating14 + type: f8 + - id: unknown_repeating15 + type: f8 + - id: unknown_repeating16 + type: f8 + - id: unknown_repeating17 + type: f8 + - id: unknown_repeating18 + type: f8 + entity: + seq: + - id: entity_type + type: s1 + enum: entities + - id: data + type: + switch-on: entity_type + cases: + 'entities::arc': entity_arc + 'entities::attdef': entity_attdef + 'entities::attrib': entity_attrib + 'entities::block_begin': entity_block_begin + 'entities::block_end': entity_block_end + 'entities::insert' : entity_insert + 'entities::circle': entity_circle + 'entities::dim': entity_dim + 'entities::face3d': entity_face3d + 'entities::line': entity_line + 'entities::line3d': entity_line3d + 'entities::point': entity_point + 'entities::polyline': entity_polyline + 'entities::polyline2': entity_polyline + 'entities::seqend': entity_seqend + 'entities::shape': entity_shape + 'entities::solid': entity_solid + 'entities::text': entity_text + 'entities::trace': entity_trace + 'entities::vertex': entity_vertex + _: entity_tmp + entity_mode: + seq: + - id: entity_mode1 + type: b1 + - id: entity_mode2 + type: b1 + - id: entity_mode3 + type: b1 + - id: entity_mode4 + type: b1 + - id: entity_thickness_flag + type: b1 + - id: entity_elevation_flag + type: b1 + - id: entity_linetype_flag + type: b1 + - id: entity_color_flag + type: b1 + entity_common: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: entity_layer_index + type: s1 + - id: flag1 + type: s1 + - id: flag2_1 + type: b1 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_6 + type: b1 + - id: flag2_7 + type: b1 + - id: flag2_8 + type: b1 + - id: flag3_1 + type: b1 + - id: flag3_2 + type: b1 + - id: flag3_3 + type: b1 + - id: flag3_4 + type: b1 + - id: flag3_5 + type: b1 + - id: flag3_6 + type: b1 + - id: flag3_7 + type: b1 + - id: flag3_8 + type: b1 + - id: entity_color + type: s1 + if: entity_mode.entity_color_flag + - id: entity_linetype_index + type: s1 + if: entity_mode.entity_linetype_flag + - id: entity_elevation + type: f8 + if: entity_mode.entity_elevation_flag + - id: entity_thickness + type: f8 + if: entity_mode.entity_thickness_flag + entity_arc: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: ARC/10 + - id: y + type: f8 + doc: ARC/20 + - id: radius + type: f8 + doc: ARC/40 + - id: angle_from + type: f8 + doc: ARC/50 + - id: angle_to + type: f8 + doc: ARC/51 + entity_attdef: + seq: + - id: entity_common + type: entity_common + - id: start_point + type: point_2d + doc: ATTDEF/10|20 + - id: height + type: f8 + doc: ATTDEF/40 + - id: default_size + type: s2 + - id: default + size: default_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/1 + - id: prompt_size + type: s2 + - id: prompt + size: prompt_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/3 + - id: tag_size + type: s2 + - id: tag + size: tag_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/2 + - id: flags + type: attdef_flags + doc: ATTDEF/70 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_7 + doc: ATTDEF/50 + - id: width_scale_factor + type: f8 + if: entity_common.flag2_6 + doc: ATTDEF/41 + - id: unknown_index + type: u1 + if: entity_common.flag2_4 + - id: flags2 + type: attdef_flags2 + if: entity_common.flag2_2 + doc: ATTDEF/72 + - id: end_point + type: point_2d + if: entity_common.flag2_1 + doc: ATTDEF/11|21 + entity_attrib: + seq: + - id: entity_common + type: entity_common + - id: u1 + type: f8 + doc: ATTRIB/10 + - id: u2 + type: f8 + doc: ATTRIB/20 + - id: u3 + type: f8 + doc: ATRRIB/40 + - id: size + type: s2 + - id: text + size: size + doc: ATRRIB/1 + - id: size2 + type: s2 + - id: text2 + size: size2 + doc: ATRRIB/2 + - id: u4 + type: u1 + - id: u5 + type: f8 + if: entity_common.flag2_7 + doc: ATRRIB/50 + - id: u6 + type: u1 + if: entity_common.flag2_4 + - id: u7 + type: u1 + if: entity_common.flag2_2 + # 1, 2 nebo 7? + - id: aligned_to + type: point_2d + if: entity_common.flag2_1 + doc: ATTRIB/11|21 + entity_block_begin: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + entity_block_end: + seq: + - id: entity_common + type: entity_common + entity_insert: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + doc: INSERT/2 + - id: x + type: f8 + doc: INSERT/10 + - id: y + type: f8 + doc: INSERT/20 + - id: x_scale + type: f8 + if: entity_common.flag2_8 + doc: INSERT/41 + - id: y_scale + type: f8 + if: entity_common.flag2_7 + doc: INSERT/42 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_6 + doc: INSERT/50 + - id: z_scale + type: f8 + if: entity_common.flag2_5 + doc: INSERT/43 + - id: columns + type: u2 + if: entity_common.flag2_4 + doc: INSERT/70 + - id: rows + type: u2 + if: entity_common.flag2_3 + doc: INSERT/71 + - id: column_spacing + type: f8 + if: entity_common.flag2_2 + doc: INSERT/44 + - id: row_spacing + type: f8 + if: entity_common.flag2_1 + doc: INSERT/45 + entity_circle: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: CIRCLE/10 + - id: y + type: f8 + doc: CIRCLE/20 + - id: radius + type: f8 + doc: CIRCLE/40 + entity_dim: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + - id: dimension_line_defining_point + type: point_2d + doc: DIMENSION/10|20 + - id: default_text_position + type: point_2d + doc: DIMENSION/11|21 + - id: unknown1 + type: u1 + if: entity_common.flag2_7 + doc: DIMENSION/70 + - id: text_size + type: s2 + if: entity_common.flag2_6 + - id: text + size: text_size + if: entity_common.flag2_6 + doc: DIMENSION/1 + - id: extension_defining_point1 + type: point_2d + if: entity_common.flag2_5 + doc: DIMENSION/13|23 + - id: extension_defining_point2 + type: point_2d + if: entity_common.flag2_4 + doc: DIMENSION/14|24 + - id: defining_point + type: point_2d + if: entity_common.flag2_3 + doc: DIMENSION/15|25 + - id: dimension_line_arc_definition_point + type: point_2d + if: entity_common.flag2_2 + - id: rotation_in_radians + type: f8 + if: entity_common.flag3_8 + entity_face3d: + seq: + - id: entity_common + type: entity_common + - id: first_point_x + type: f8 + - id: first_point_y + type: f8 + - id: first_point_z + type: f8 + if: entity_common.flag2_8 + - id: second_point_x + type: f8 + - id: second_point_y + type: f8 + - id: second_point_z + type: f8 + if: entity_common.flag2_7 + - id: third_point_x + type: f8 + - id: third_point_y + type: f8 + - id: third_point_z + type: f8 + if: entity_common.flag2_6 + - id: fourth_point_x + type: f8 + - id: fourth_point_y + type: f8 + - id: fourth_point_z + type: f8 + if: entity_common.flag2_5 + entity_line: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: LINE/10 + - id: y1 + type: f8 + doc: LINE/20 + - id: x2 + type: f8 + doc: LINE/11 + - id: y2 + type: f8 + doc: LINE/21 + entity_line3d: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: 3DLINE/10 + - id: y1 + type: f8 + doc: 3DLINE/20 + - id: z1 + type: f8 + if: entity_common.flag2_8 + doc: 3DLINE/30 + - id: x2 + type: f8 + doc: 3DLINE/11 + - id: y2 + type: f8 + doc: 3DLINE/21 + - id: z2 + type: f8 + if: entity_common.flag2_7 + doc: 3DLINE/31 + entity_tmp: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: entity_layer_index + type: s1 + - id: flag1 + type: s1 + - id: flag2_1 + type: b1 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_6 + type: b1 + - id: flag2_7 + type: b1 + - id: flag2_8 + type: b1 + - id: flag3_1 + type: b1 + - id: flag3_2 + type: b1 + - id: flag3_3 + type: b1 + - id: flag3_4 + type: b1 + - id: flag3_5 + type: b1 + - id: flag3_6 + type: b1 + - id: flag3_7 + type: b1 + - id: flag3_8 + type: b1 + - id: xxx + size: entity_size - 8 + entity_point: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: POINT/10 + - id: y + type: f8 + doc: POINT/20 + entity_polyline: + seq: + - id: entity_common + type: entity_common + - id: closed + type: u1 + if: entity_common.flag2_8 + doc: POLYLINE/66 + - id: x + type: f8 + if: entity_common.flag2_7 + doc: POLYLINE/40 + - id: y + type: f8 + if: entity_common.flag2_6 + doc: POLYLINE/41 + entity_seqend: + seq: + - id: entity_common + type: entity_common + - id: unknown + size: 4 + entity_shape: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: item_num + type: u1 + - id: angle + type: f8 + if: entity_common.flag2_8 + - id: load_num + type: u1 + entity_solid: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_text: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: TEXT/10 + - id: y + type: f8 + doc: TEXT/20 + - id: height + type: f8 + doc: TEXT/40 + - id: size + type: s2 + - id: value + size: size + type: str + encoding: ASCII + terminator: 0x00 + doc: TEXT/1 + - id: angle + type: f8 + if: entity_common.flag2_8 + doc: TEXT/50 + - id: width_factor + type: f8 + if: entity_common.flag2_7 + doc: TEXT/41 + - id: obliquing_angle + type: f8 + if: entity_common.flag2_6 + doc: TEXT/51 + - id: style_index + type: u1 + if: entity_common.flag2_5 + doc: TEXT/7 + - id: generation + type: generation_flags + if: entity_common.flag2_4 + doc: TEXT/71 + - id: type + enum: text_type + type: u1 + if: entity_common.flag2_3 + doc: TEXT/72 + - id: aligned_to + type: point_2d + if: entity_common.flag2_2 + doc: TEXT/11|21 + entity_trace: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_vertex: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: VERTEX/10 + - id: y + type: f8 + doc: VERTEX/20 + - id: width + type: f8 + if: entity_common.flag2_8 + - id: unknown1 + type: f8 + if: entity_common.flag2_7 + - id: bulge + type: f8 + if: entity_common.flag2_6 + doc: VERTEX/42 + - id: unknown2 + type: u1 + if: entity_common.flag2_5 + - id: unknown_in_radians + type: f8 + if: entity_common.flag2_4 + doc: VERTEX/50 + attdef_flags: + seq: + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: invisible + type: b1 + - id: constant + type: b1 + - id: verify + type: b1 + attdef_flags2: + seq: +## TODO Tohle je divne + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: middle + type: b1 + - id: right + type: b1 + - id: center + type: b1 + layer: + seq: + - id: flag + type: layer_flag + doc: LAYER/70 + - id: layer_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LAYER/2 + - id: color + type: s2 + doc: LAYER/62 + - id: linetype_index + type: u2 + doc: LAYER/6 + layer_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + linetype: + seq: + - id: flag + type: linetype_flag + doc: LTYPE/70 + - id: linetype_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/2 + - id: description + size: 48 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/3 + - id: alignment + type: u1 + doc: LTYPE/72 + - id: num_dashes + type: u1 + doc: LTYPE/73 + - id: pattern_len + type: f8 + doc: LTYPE/40 + - id: pattern + type: pattern + doc: LTYPE/49 + pattern: + seq: + - id: pattern1 + type: f8 + - id: pattern2 + type: f8 + - id: pattern3 + type: f8 + - id: pattern4 + type: f8 + - id: pattern5 + type: f8 + - id: pattern6 + type: f8 + - id: pattern7 + type: f8 + - id: pattern8 + type: f8 + - id: pattern9 + type: f8 + - id: pattern10 + type: f8 + - id: pattern11 + type: f8 + - id: pattern12 + type: f8 + linetype_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + real_entities: + seq: + - id: entities + type: entity + repeat: eos + style: + seq: + - id: flag + type: style_flag + doc: STYLE/70 + - id: style_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/2 + - id: height + type: f8 + doc: STYLE/40 + - id: width_factor + type: f8 + doc: STYLE/41 + - id: obliquing_angle_in_radians + type: f8 + doc: STYLE/50 + - id: generation + type: generation_flags + doc: STYLE/71 + - id: last_height + type: f8 + doc: STYLE/42 + - id: font_file + size: 64 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/3 + - id: u1 + size: 64 + style_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: vertical + type: b1 + - id: flag7 + type: b1 + - id: load + type: b1 + view: + seq: + - id: flag + type: view_flag + doc: VIEW/70 + - id: view_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + - id: view_size + type: f8 + doc: VIEW/40 + - id: center_point + type: point_2d + doc: VIEW/10|20 + - id: view_width + type: f8 + doc: VIEW/41 + - id: view_dir + type: point_3d + doc: VIEW/11|21|31 + - id: u3 + type: s2 + view_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + generation_flags: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: upside_down + type: b1 + - id: backwards + type: b1 + - id: flag8 + type: b1 + point_2d: + seq: + - id: x + type: f8 + - id: y + type: f8 + point_3d: + seq: + - id: x + type: f8 + - id: y + type: f8 + - id: z + type: f8 +enums: + entities: + 1: line + 2: point + 3: circle + 4: shape + # NOT_USED 5: repeat_begin + # NOT_USED 6: repeat_end + 7: text + 8: arc + 9: trace + # NOT_USED 10: load + 11: solid + 12: block_begin + 13: block_end + 14: insert + 15: attdef + 16: attrib + 17: seqend + 18: polyline + 19: polyline2 + 20: vertex + 21: line3d + 22: face3d + 23: dim + osnap_modes: + 0: none + 1: endpoint + 2: midpoint + 4: center + 8: node + 16: quadrant + 32: intersection + 64: insertion + 128: perpendicular + 256: tangent + 512: nearest + unit_types: + 1: scientific + 2: decimal + 3: engineering + 4: architectural + 5: fractional + units_for_angles: + 0: decimal_degrees + 1: degrees_minutes_seconds + 2: gradians + 3: radians + 4: surveyor_s_units + angle_direction: + 0: counterclockwise + 1: clockwise + limits_check: + 0: objects_can_outside_grid + 1: objects_cannot_outside_grid + coordinates: + 0: absolute_coordinates + 1: absolute_coordinates_realtime + 2: relative_polar_coordinates + attributes: + 0: off + 1: normal + 2: on + current_color: + 0: byblock + 1: red + 2: yellow + 3: green + 4: cyan + 5: blue + 6: magenta + 7: white + 256: bylayer + iso_plane: + 0: left + 1: top + 2: right + text_type: + 1: center + 2: end + 3: aligned + 4: middle + 5: fit diff --git a/dwg_ac1006.ksy b/dwg_ac1006.ksy new file mode 100644 index 0000000..1be5f23 --- /dev/null +++ b/dwg_ac1006.ksy @@ -0,0 +1,1877 @@ +meta: + id: dwg_ac1006 + title: AutoCAD drawing (AC1006) + application: AutoCAD + file-extension: + - dwg + license: CC0-1.0 + xref: + justsolve: DWG + pronom: + fmt: 31 + mime: + - application/x-dwg + - image/vnd.dwg + wikidata: Q27863123 + endian: le +seq: + - id: header + type: header + - id: entities + type: real_entities + size: header.entities_end - header.entities_start + - id: blocks + type: block + repeat: expr + repeat-expr: header.table_block.items + - id: layers + type: layer + repeat: expr + repeat-expr: header.table_layer.items + - id: styles + type: style + repeat: expr + repeat-expr: header.table_style.items + - id: linetypes + type: linetype + repeat: expr + repeat-expr: header.table_linetype.items + - id: views + type: view + repeat: expr + repeat-expr: header.table_view.items + # TODO Je tady nejaka chyba (AC1006/from_autocad_r10/TUTORIAL.DWG) + - id: ucss + type: ucs + repeat: expr + repeat-expr: header.variables.table_ucs.items + - id: vports + type: vport + repeat: expr + repeat-expr: header.variables.table_vport.items + - id: appids + type: appid + repeat: expr + repeat-expr: header.variables.table_appid.items + if: header.num_header_vars == 160 + - id: block_entities + type: real_entities + size: header.blocks_size + - id: todo + size-eos: true + repeat: eos + if: not _io.eof +types: + block: + seq: + - id: flag + type: block_flag + doc: BLOCK/70 + - id: block_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: BLOCK/2 + - id: u2 + type: s1 + - id: u3 + type: s1 + - id: u4 + type: s1 + - id: u5 + type: s1 + block_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + header: + seq: + - id: magic + contents: [0x41, 0x43, 0x31, 0x30, 0x30, 0x36] + doc: 0x0000-0x0005, $ACADVER + - id: zeros + size: 6 + - id: zero_one_or_three + type: s1 + - id: unknown_3 + type: s2 + - id: num_sections + type: s2 + - id: num_header_vars + type: s2 + - id: dwg_version + type: s1 + - id: entities_start + type: s4 + - id: entities_end + type: s4 + - id: blocks_start + type: s4 + - id: blocks_size_raw + type: u4 + - id: blocks_end + type: s4 + - id: unknown4b + size: 2 + - id: unknown4c + size: 2 + - id: table_block + type: table + - id: table_layer + type: table + - id: table_style + type: table + - id: table_linetype + type: table + - id: table_view + type: table + - id: variables + type: header_variables + instances: + blocks_size_unknown: + value: (blocks_size_raw & 0xff000000) >> 24 + blocks_size: + value: (blocks_size_raw & 0x00ffffff) + table: + seq: + - id: item_size + type: u2 + - id: items + type: u2 + - id: unknown + size: 2 + - id: begin + type: u4 + header_variables: + seq: + - id: insertion_base + type: point_3d + doc: 0x005e-0x0075, $INSBASE/10|20|30 + - id: plinegen + type: s2 + doc: 0x0076-0x0077, $PLINEGEN/70 + - id: drawing_first + type: point_3d + doc: 0x0078-0x008f, $EXTMIN/10|20|30 + - id: drawing_second + type: point_3d + doc: 0x0090-0x00a7, $EXTMAX/10|20|30 + - id: limits_min + type: point_2d + doc: 0x00a8-0x00b7, $LIMMIN/10|20 + - id: limits_max + type: point_2d + doc: 0x00b8-0x00c7, $LIMMAX/10|20 + - id: view_ctrl + type: point_3d + doc: 0x00c8-0x00da, $VIEWCTRL/10|20|30 + - id: view_size + type: f8 + doc: 0x00e0-0x00e7 + - id: snap + type: s2 + doc: 0x00e8-0x00e9, $SNAPMODE + - id: snap_resolution + type: point_2d + doc: 0x00ea-0x00f9, $SNAPUNIT/10|20 + - id: snap_base + type: point_2d + doc: 0x00fa-0x0109, $SNAPBASE/10|20 + - id: snap_angle + type: f8 + doc: 0x010a-0x0111, $SNAPANG + - id: snap_style + type: s2 + doc: 0x0112-0x0113, $SNAPSTYLE + - id: snap_iso_pair + type: s2 + enum: iso_plane + doc: 0x0114-0x0115, $SNAPISOPAIR + - id: grid + type: s2 + doc: 0x0116-0x0117, $GRIDMODE + - id: grid_unit + type: point_2d + doc: 0x0118-0x0127, $GRIDUNIT/10|20 + - id: ortho + type: s2 + doc: 0x0128-0x0129, $ORTHOMODE + - id: regen + type: s2 + doc: 0x012a-0x012b, $REGENMODE + - id: fill + type: s2 + doc: 0x012c-0x012d, $FILLMODE + - id: qtext + type: s2 + doc: 0x012e-0x012f, $QTEXTMODE + - id: drag + type: s2 + doc: 0x0130-0x0131, $DRAGMODE + - id: linetype_scale + type: f8 + doc: 0x0132-0x0139, $LTSCALE + - id: text_size + type: f8 + doc: 0x013a-0x0141, $TEXTSIZE + - id: trace_width + type: f8 + doc: 0x0142-0x0149, $TRACEWID + - id: current_layer_index + type: s2 + doc: 0x014a-0x014b, $CLAYER + - id: current_color_convert + type: f8 + doc: 0x014c-0x0153 + - id: unknown7a + size: 2 + doc: 0x0154-0x0155 + - id: unknown7b + size: 2 + doc: 0x0156-0x0157 + - id: unknown7c + size: 2 + doc: 0x0158-0x0159 + - id: unknown7d + size: 2 + doc: 0x015a-0x015b + - id: unknown8 + type: f8 + doc: 0x015c-0x0163 + - id: linear_units_format + enum: unit_types + type: s2 + doc: 0x0164-0x0165, $LUNITS + - id: linear_units_precision + type: s2 + doc: 0x0166-0x0167, $LUPREC + - id: axis + type: s2 + doc: 0x0168-0x0169, $AXISMODE/70 + - id: axis_value + type: point_2d + doc: 0x016a-0x0179, $AXISUNIT/10|20 + - id: sketch_increment + type: f8 + doc: 0x017a-0x0181, $SKETCHINC + - id: fillet_radius + type: f8 + doc: $FILLETRAD + - id: units_for_angles + enum: units_for_angles + type: s2 + doc: $AUNITS + - id: angular_precision + type: s2 + doc: $AUPREC + - id: text_style_index + type: s2 + doc: 0x018e-0x018f, $TEXTSTYLE (index) + - id: osnap + enum: osnap_modes + type: s2 + doc: 0x0190-0x0191, $OSMODE + - id: attributes + enum: attributes + type: s2 + doc: 0x0192-0x0193, $ATTMODE + - id: menu + size: 15 + type: str + encoding: ASCII + terminator: 0x00 + doc: 0x0194-0x01a2, $MENU + - id: dim_scale + type: f8 + doc: 0x01a3-0x01aa, $DIMSCALE + - id: dim_arrowhead_size + type: f8 + doc: $DIMASZ + - id: dim_extension_line_offset + type: f8 + doc: $DIMEXO + - id: dim_baseline_spacing + type: f8 + doc: $DIMDLI + - id: dim_extension_line_extend + type: f8 + doc: $DIMEXE + - id: dim_maximum_tolerance_limit + type: f8 + doc: 0x01cb-0x01d2, $DIMTP + - id: dim_minimum_tolerance_limit + type: f8 + doc: 0x01d3-0x01da, $DIMTM + - id: dim_text_height + type: f8 + doc: 0x01db-0x01e2, $DIMTXT + - id: dim_center_mark_control + type: f8 + doc: 0x01e3-0x01ea, $DIMCEN + - id: dim_oblique_stroke_size + type: f8 + doc: 0x01eb-0x01f2, $DIMTSZ + - id: dim_tolerances + type: s1 + doc: 0x01f3, $DIMTOL + - id: dim_limits_default_text + type: s1 + doc: 0x01f4, $DIMLIM + - id: dim_text_ext_inside_line_position + type: s1 + doc: 0x01f5, $DIMTIH + - id: dim_text_ext_outside_line_position + type: s1 + doc: 0x01f6, $DIMTOH + - id: dim_extension_line_first_suppress + type: s1 + doc: 0x01f7, $DIMSE1 + - id: dim_extension_line_second_suppress + type: s1 + doc: 0x01f8, $DIMSE2 + - id: dim_text_vertical_position + type: s1 + doc: 0x01f9, $DIMTAD + - id: limits_check + enum: limits_check + type: s2 + doc: 0x01fa-0x01fb, $LIMCHECK + - id: unknown10 + size: 45 + - id: elevation + type: f8 + doc: 0x0229-0x0230, $ELEVATION + - id: thickness + type: f8 + doc: 0x0231-0x0238, $THICKNESS + - id: view_point + type: point_3d + doc: 0x0239-0x0251, $VIEWDIR/10|20|30 + - id: unknown_repeating + type: unknown_repeating + doc: 0x0252-0x02e0 + - id: unknown29 + type: s2 + doc: 0x02e1-0x02e2 + - id: blip + type: s2 + doc: 0x02e3-0x02e4, $BLIPMODE + - id: dim_suppression_of_zeros + type: s1 + doc: 0x02e5, $DIMZIN + - id: dim_rounding + type: f8 + doc: 0x02e6-0x02ed, $DIMRND + - id: dim_extension_line_extend2 + type: f8 + doc: 0x02ee-0x02f5, $DIMDLE + - id: dim_arrowhead_block + size: 33 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMBLK + - id: circle_zoom_percent + type: s2 + doc: 0x0317-0x0318 + - id: coordinates + enum: coordinates + type: s2 + doc: 0x0319-0x031a, $COORDS + - id: current_color + enum: current_color + type: s2 + doc: 256d - bylayer, 0d - byblock, other index (1-255), $CECOLOR + - id: current_linetype + type: s2 + doc: 256d - bylayer, 255d - byblock, other index, $CELTYPE + - id: create_date_days + type: u4 + doc: $TDCREATE/days + - id: create_date_ms + type: u4 + doc: $TDCREATE/ms + - id: update_date_days + type: u4 + doc: $TDUPDATE/days + - id: update_date_ms + type: u4 + doc: $TDUPDATE/ms + - id: total_editing_time_days + type: u4 + doc: $TDINDWG/days + - id: total_editing_time_ms + type: u4 + doc: $TDINDWG/ms + - id: user_elapsed_timer_days + type: u4 + doc: $TDUSRTIMER/days + - id: user_elapsed_timer_ms + type: u4 + doc: $TDUSRTIMER/ms + - id: user_timer + type: s2 + doc: 0x033f-0x0340, $USRTIMER + - id: fast_zoom + type: u2 + doc: 0x0341, $FASTZOOM + - id: sketch_type + type: u2 + doc: 0x0343, $SKPOLY + - id: unknown33a + type: u2 + - id: unknown33b + type: u2 + - id: unknown33c + type: u2 + - id: unknown33d + type: u2 + - id: unknown33e + type: u2 + - id: unknown33f + type: u2 + - id: unknown33g + type: u2 + - id: angle_base + type: f8 + doc: 0x0353-0x035a, $ANGBASE + - id: angle_direction + enum: angle_direction + type: s2 + doc: 0x035b-0x035c, $ANGDIR + - id: point_mode + type: s2 + doc: 0x035d-0x035e, $PDMODE + - id: point_size + type: f8 + doc: $PDSIZE + - id: polyline_width + type: f8 + doc: $PLINEWID + - id: user_integer_1 + type: s2 + doc: 0x035f-0x0360, $USERI1 + - id: user_integer_2 + type: s2 + doc: 0x0361-0x0362, $USERI2 + - id: user_integer_3 + type: s2 + doc: 0x0363-0x0364, $USERI3 + - id: user_integer_4 + type: s2 + doc: 0x0365-0x0366, $USERI4 + - id: user_integer_5 + type: s2 + doc: 0x0367-0x0368, $USERI5 + - id: user_real_1 + type: f8 + doc: $USERR1 + - id: user_real_2 + type: f8 + doc: $USERR2 + - id: user_real_3 + type: f8 + doc: $USERR3 + - id: user_real_4 + type: f8 + doc: $USERR4 + - id: user_real_5 + type: f8 + doc: $USERR5 + - id: dim_alternate_units + type: s1 + doc: 0x03a1, $DIMALT + - id: dim_alternate_units_decimal_places + type: s1 + doc: 0x03a2, $DIMALTD + - id: dim_associative + type: s1 + doc: 0x03a3, $DIMASO + - id: dim_sho + type: s1 + doc: 0x03a4, $DIMSHO + - id: dim_measurement_postfix + size: 16 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMPOST, TODO And prefix? + - id: dim_alternate_measurement_postfix + size: 16 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMAPOST, TODO And prefix + - id: dim_alternate_units_multiplier + type: f8 + doc: 0x03c5-0x03cc, $DIMALTF + - id: dim_linear_measurements_scale_factor + type: f8 + doc: 0x03cd-0x03d4, $DIMLFAC + - id: spline_segs + type: s2 + doc: 0x03d5-0x03d6, $SPLINESEGS + - id: spline_frame + type: s2 + doc: 0x03d7-0x03d8, $SPLFRAME + - id: attreq + type: u2 + doc: 0x03d9-0x03da, $ATTREQ + - id: attdia + type: u2 + doc: 0x03db-0x03dc, $ATTDIA + - id: chamfera + type: f8 + doc: 0x03dd-0x04e4, $CHAMFERA/40 + - id: chamferb + type: f8 + doc: 0x04e5-0x04ec, $CHAMFERB/40 + - id: mirror_text + type: s2 + doc: 0x03ed-0x03ee, $MIRRTEXT + - id: table_ucs + type: table + - id: unknown37 + size: 2 + - id: ucs_origin_point + type: point_3d + doc: $UCSORG/10|20|30 + - id: ucs_x_dir + type: point_3d + doc: $UCSXDIR/11|21|31 ~ $UCSXORI + - id: ucs_y_dir + type: point_3d + doc: $UCSYDIR/12|22|32 ~ $UCSYORI + - id: target + type: point_3d + doc: $TARGET + - id: lens_length + type: f8 + doc: $LENSLENGTH + - id: view_rotation_angle_radians + type: f8 + doc: $VIEWTWIST + - id: unknown42a + type: f8 + doc: $BACKZ or $FRONTZ + - id: unknown42b + type: f8 + doc: $BACKZ or $FRONTZ + - id: unknown42c + type: u2 + - id: dim_tofl + type: u1 + doc: 0x047d, $DIMTOFL + - id: dim_arrowhead_block1 + size: 33 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMBLK1 + - id: dim_arrowhead_block2 + size: 33 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMBLK2 + - id: dim_arrowhead_blocks_control + type: u1 + doc: $DIMSAH + - id: dim_text_between_ext_lines + type: u1 + doc: $DIMTIX + - id: dim_arrowhead_suppress + type: u1 + doc: $DIMSOXD + - id: dim_text_vertical_position_size + type: f8 + doc: $DIMTVP + - id: unknown440 + size: 33 + - id: handling + type: u2 + doc: $HANDLING + - id: handseed + type: u8be + doc: $HANDSEED, in hex + - id: surfu + type: u2 + doc: $SURFU + - id: surfv + type: u2 + doc: $SURFV + - id: surftype + type: u2 + doc: $SURFTYPE + - id: surftab1 + type: u2 + doc: $SURFTAB1 + - id: surftab2 + type: u2 + doc: $SURFTAB2 + - id: table_vport + type: table + - id: flatland + type: u2 + doc: 0x050a-0x050b, $FLATLAND + - id: spline_type + type: u2 + enum: spline_type + doc: 0x050c-0x050d, $SPLINETYPE + - id: ucs_icon + type: u2 + doc: $UCSICON + - id: unknown47 + type: u2 + - id: table_appid + type: table + doc: 0x0512-0x051c + if: _parent.num_header_vars == 160 + - id: unknown48 + type: u2 + if: _parent.num_header_vars == 160 + instances: + create_date: + value: create_date_days + (create_date_ms / 86400000.0) + update_date: + value: update_date_days + (update_date_ms / 86400000.0) + unknown_repeating: + seq: + - id: unknown_repeating1 + type: f8 + - id: unknown_repeating2 + type: f8 + - id: unknown_repeating3 + type: f8 + - id: unknown_repeating4 + type: f8 + - id: unknown_repeating5 + type: f8 + - id: unknown_repeating6 + type: f8 + - id: unknown_repeating7 + type: f8 + - id: unknown_repeating8 + type: f8 + - id: unknown_repeating9 + type: f8 + - id: unknown_repeating10 + type: f8 + - id: unknown_repeating11 + type: f8 + - id: unknown_repeating12 + type: f8 + - id: unknown_repeating13 + type: f8 + - id: unknown_repeating14 + type: f8 + - id: unknown_repeating15 + type: f8 + - id: unknown_repeating16 + type: f8 + - id: unknown_repeating17 + type: f8 + - id: unknown_repeating18 + type: f8 + entity: + seq: + - id: entity_type + type: s1 + enum: entities + - id: data + type: + switch-on: entity_type + cases: + 'entities::arc': entity_arc + 'entities::attdef': entity_attdef + 'entities::attrib': entity_attrib + 'entities::block_begin': entity_block_begin + 'entities::block_end': entity_block_end + 'entities::insert' : entity_insert + 'entities::circle': entity_circle + 'entities::dim': entity_dim + 'entities::face3d': entity_face3d + 'entities::line': entity_line + 'entities::line3d': entity_line3d + 'entities::point': entity_point + 'entities::polyline': entity_polyline + 'entities::polyline2': entity_polyline + 'entities::seqend': entity_seqend + 'entities::shape': entity_shape + 'entities::solid': entity_solid + 'entities::text': entity_text + 'entities::trace': entity_trace + 'entities::vertex': entity_vertex + _: entity_tmp + entity_mode: + seq: + - id: entity_mode1 + type: b1 + - id: entity_mode2 + type: b1 + - id: entity_mode3 + type: b1 + - id: entity_mode4 + type: b1 + - id: entity_thickness_flag + type: b1 + - id: entity_elevation_flag + type: b1 + - id: entity_linetype_flag + type: b1 + - id: entity_color_flag + type: b1 + entity_common: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: entity_layer_index + type: s1 + - id: flag1 + type: s1 + - id: flag2_1 + type: b1 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_6 + type: b1 + - id: flag2_7 + type: b1 + - id: flag2_8 + type: b1 + - id: flag3_1 + type: b1 + - id: flag3_2 + type: b1 + - id: flag3_3 + type: b1 + - id: flag3_4 + type: b1 + - id: flag3_5 + type: b1 + - id: flag3_6 + type: b1 + - id: flag3_7 + type: b1 + - id: flag3_8 + type: b1 + - id: entity_color + type: s1 + if: entity_mode.entity_color_flag + - id: entity_linetype_index + type: s1 + if: entity_mode.entity_linetype_flag + - id: entity_thickness + type: f8 + if: entity_mode.entity_thickness_flag + entity_arc: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: ARC/10 + - id: y + type: f8 + doc: ARC/20 + - id: z + type: f8 + doc: ARC/30 + if: entity_common.entity_mode.entity_elevation_flag == true + - id: radius + type: f8 + doc: ARC/40 + - id: angle_from + type: f8 + doc: ARC/50 + - id: angle_to + type: f8 + doc: ARC/51 + - id: extrusion_direction + type: point_3d + if: entity_common.flag2_8 + doc: ARC/210|220|230 + entity_attdef: + seq: + - id: entity_common + type: entity_common + - id: start_point + type: point_2d + doc: ATTDEF/10|20 + - id: height + type: f8 + doc: ATTDEF/40 + - id: default_size + type: s2 + - id: default + size: default_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/1 + - id: prompt_size + type: s2 + - id: prompt + size: prompt_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/3 + - id: tag_size + type: s2 + - id: tag + size: tag_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/2 + - id: flags + type: attdef_flags + doc: ATTDEF/70 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_7 + doc: ATTDEF/50 + - id: width_scale_factor + type: f8 + if: entity_common.flag2_6 + doc: ATTDEF/41 + - id: unknown_index + type: u1 + if: entity_common.flag2_4 + - id: flags2 + type: attdef_flags2 + if: entity_common.flag2_2 + doc: ATTDEF/72 + - id: end_point + type: point_2d + if: entity_common.flag2_1 + doc: ATTDEF/11|21 + entity_attrib: + seq: + - id: entity_common + type: entity_common + - id: u1 + type: f8 + doc: ATTRIB/10 + - id: u2 + type: f8 + doc: ATTRIB/20 + - id: u3 + type: f8 + doc: ATRRIB/40 + - id: size + type: s2 + - id: text + size: size + doc: ATRRIB/1 + - id: size2 + type: s2 + - id: text2 + size: size2 + doc: ATRRIB/2 + - id: u4 + type: u1 + - id: u5 + type: f8 + if: entity_common.flag2_7 + doc: ATRRIB/50 + - id: u6 + type: u1 + if: entity_common.flag2_4 + - id: u7 + type: u1 + if: entity_common.flag2_2 + # 1, 2 nebo 7? + - id: aligned_to + type: point_2d + if: entity_common.flag2_1 + doc: ATTRIB/11|21 + entity_block_begin: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + entity_block_end: + seq: + - id: entity_common + type: entity_common + entity_insert: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + doc: INSERT/2 + - id: x + type: f8 + doc: INSERT/10 + - id: y + type: f8 + doc: INSERT/20 + - id: z + type: f8 + doc: ARC/30 + if: entity_common.entity_mode.entity_elevation_flag == true + - id: x_scale + type: f8 + if: entity_common.flag2_8 + doc: INSERT/41 + - id: y_scale + type: f8 + if: entity_common.flag2_7 + doc: INSERT/42 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_6 + doc: INSERT/50 + - id: z_scale + type: f8 + if: entity_common.flag2_5 + doc: INSERT/43 + - id: columns + type: u2 + if: entity_common.flag2_4 + doc: INSERT/70 + - id: rows + type: u2 + if: entity_common.flag2_3 + doc: INSERT/71 + - id: column_spacing + type: f8 + if: entity_common.flag2_2 + doc: INSERT/44 + - id: row_spacing + type: f8 + if: entity_common.flag2_1 + doc: INSERT/45 + - id: extrusion_direction + type: point_3d + if: entity_common.flag3_8 + doc: INSERT/210|220|230 + entity_circle: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: CIRCLE/10 + - id: y + type: f8 + doc: CIRCLE/20 + - id: z + type: f8 + doc: CIRCLE/30 + if: entity_common.entity_mode.entity_elevation_flag == true + - id: radius + type: f8 + doc: CIRCLE/40 + entity_dim: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + - id: dimension_line_defining_point + type: point_2d + doc: DIMENSION/10|20 + - id: dimension_line_defining_point_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false + doc: DIMENSION/30 + - id: default_text_position + type: point_2d + doc: DIMENSION/11|21 +# - id: default_text_position_z +# type: f8 +# if: entity_common.entity_mode.entity_elevation_flag == false +# doc: DIMENSION/31 + - id: unknown1 + type: u1 + if: entity_common.flag2_7 + doc: DIMENSION/70 + - id: text_size + type: s2 + if: entity_common.flag2_6 + - id: text + size: text_size + if: entity_common.flag2_6 + doc: DIMENSION/1 + - id: extension_defining_point1 + type: point_2d + if: entity_common.flag2_5 + doc: DIMENSION/13|23 + - id: extension_defining_point1_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false and entity_common.flag2_5 + doc: DIMENSION/33 + - id: extension_defining_point2 + type: point_2d + if: entity_common.flag2_4 + doc: DIMENSION/14|24 + - id: extension_defining_point2_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false and entity_common.flag2_4 + doc: DIMENSION/34 + - id: defining_point + type: point_2d + if: entity_common.flag2_3 + doc: DIMENSION/15|25 + - id: defining_point_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false and entity_common.flag2_3 + doc: DIMENSION/35 + - id: dimension_line_arc_definition_point + type: point_2d + if: entity_common.flag2_2 + - id: dimension_line_arc_definition_point_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false and entity_common.flag2_2 + - id: unknown2 + type: point_2d + if: entity_common.flag2_1 + - id: unknown2_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false and entity_common.flag2_1 + - id: rotation_in_radians + type: f8 + if: entity_common.flag3_8 + entity_face3d: + seq: + - id: entity_common + type: entity_common + - id: first_point_x + type: f8 + - id: first_point_y + type: f8 + - id: first_point_z + type: f8 + if: entity_common.flag2_8 + - id: second_point_x + type: f8 + - id: second_point_y + type: f8 + - id: second_point_z + type: f8 + if: entity_common.flag2_7 + - id: third_point_x + type: f8 + - id: third_point_y + type: f8 + - id: third_point_z + type: f8 + if: entity_common.flag2_6 + - id: fourth_point_x + type: f8 + - id: fourth_point_y + type: f8 + - id: fourth_point_z + type: f8 + if: entity_common.flag2_5 + entity_line: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: LINE/10 + - id: y1 + type: f8 + doc: LINE/20 + - id: z1 + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false + doc: LINE/30 + - id: x2 + type: f8 + doc: LINE/11 + - id: y2 + type: f8 + doc: LINE/21 + - id: z2 + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false + doc: LINE/31 + - id: extrusion_direction + type: point_3d + if: entity_common.flag2_8 + doc: LINE/210|220|230 + entity_line3d: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: 3DLINE/10 + - id: y1 + type: f8 + doc: 3DLINE/20 + - id: z1 + type: f8 + doc: 3DLINE/30 + - id: x2 + type: f8 + doc: 3DLINE/11 + - id: y2 + type: f8 + doc: 3DLINE/21 + - id: z2 + type: f8 + doc: 3DLINE/31 + - id: extrusion_direction + type: point_3d + if: entity_common.flag2_8 + doc: 3DLINE/210|220|230 + entity_tmp: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: entity_layer_index + type: s1 + - id: flag1 + type: s1 + - id: flag2_1 + type: b1 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_6 + type: b1 + - id: flag2_7 + type: b1 + - id: flag2_8 + type: b1 + - id: flag3_1 + type: b1 + - id: flag3_2 + type: b1 + - id: flag3_3 + type: b1 + - id: flag3_4 + type: b1 + - id: flag3_5 + type: b1 + - id: flag3_6 + type: b1 + - id: flag3_7 + type: b1 + - id: flag3_8 + type: b1 + - id: xxx + size: entity_size - 8 + entity_point: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: POINT/10 + - id: y + type: f8 + doc: POINT/20 + - id: z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false + doc: POINT/30 + entity_polyline: + seq: + - id: entity_common + type: entity_common + - id: closed + type: u1 + if: entity_common.flag2_8 + doc: POLYLINE/66 + - id: x + type: f8 + if: entity_common.flag2_7 + doc: POLYLINE/40 + - id: y + type: f8 + if: entity_common.flag2_6 + doc: POLYLINE/41 + entity_seqend: + seq: + - id: entity_common + type: entity_common + - id: unknown + size: 4 + entity_shape: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: item_num + type: u1 + - id: angle + type: f8 + if: entity_common.flag2_8 + - id: load_num + type: u1 + entity_solid: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_text: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: TEXT/10 + - id: y + type: f8 + doc: TEXT/20 + - id: height + type: f8 + doc: TEXT/40 + - id: size + type: s2 + - id: value + size: size + type: str + encoding: ASCII + terminator: 0x00 + doc: TEXT/1 + - id: angle + type: f8 + if: entity_common.flag2_8 + doc: TEXT/50 + - id: width_factor + type: f8 + if: entity_common.flag2_7 + doc: TEXT/41 + - id: obliquing_angle + type: f8 + if: entity_common.flag2_6 + doc: TEXT/51 + - id: style_index + type: u1 + if: entity_common.flag2_5 + doc: TEXT/7 + - id: generation + type: generation_flags + if: entity_common.flag2_4 + doc: TEXT/71 + - id: type + enum: text_type + type: u1 + if: entity_common.flag2_3 + doc: TEXT/72 + - id: aligned_to + type: point_2d + if: entity_common.flag2_2 + doc: TEXT/11|21 + entity_trace: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_vertex: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: VERTEX/10 + - id: y + type: f8 + doc: VERTEX/20 + - id: width + type: f8 + if: entity_common.flag2_8 + - id: unknown1 + type: f8 + if: entity_common.flag2_7 + - id: bulge + type: f8 + if: entity_common.flag2_6 + doc: VERTEX/42 + - id: unknown2 + type: u1 + if: entity_common.flag2_5 + - id: unknown_in_radians + type: f8 + if: entity_common.flag2_4 + doc: VERTEX/50 + attdef_flags: + seq: + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: invisible + type: b1 + - id: constant + type: b1 + - id: verify + type: b1 + attdef_flags2: + seq: +## TODO Tohle je divne + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: middle + type: b1 + - id: right + type: b1 + - id: center + type: b1 + layer: + seq: + - id: flag + type: layer_flag + doc: LAYER/70 + - id: layer_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LAYER/2 + - id: color + type: s2 + doc: LAYER/62 + - id: linetype_index + type: u2 + doc: LAYER/6 + layer_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + linetype: + seq: + - id: flag + type: linetype_flag + doc: LTYPE/70 + - id: linetype_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/2 + - id: description + size: 48 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/3 + - id: alignment + type: u1 + doc: LTYPE/72 + - id: num_dashes + type: u1 + doc: LTYPE/73 + - id: pattern_len + type: f8 + doc: LTYPE/40 + - id: pattern + type: pattern + doc: LTYPE/49 + pattern: + seq: + - id: pattern1 + type: f8 + - id: pattern2 + type: f8 + - id: pattern3 + type: f8 + - id: pattern4 + type: f8 + - id: pattern5 + type: f8 + - id: pattern6 + type: f8 + - id: pattern7 + type: f8 + - id: pattern8 + type: f8 + - id: pattern9 + type: f8 + - id: pattern10 + type: f8 + - id: pattern11 + type: f8 + - id: pattern12 + type: f8 + linetype_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + real_entities: + seq: + - id: entities + type: entity + repeat: eos + style: + seq: + - id: flag + type: style_flag + doc: STYLE/70 + - id: style_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/2 + - id: height + type: f8 + doc: STYLE/40 + - id: width_factor + type: f8 + doc: STYLE/41 + - id: obliquing_angle_in_radians + type: f8 + doc: STYLE/50 + - id: generation + type: generation_flags + doc: STYLE/71 + - id: last_height + type: f8 + doc: STYLE/42 + - id: font_file + size: 64 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/3 + - id: u1 + size: 64 + style_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: vertical + type: b1 + - id: flag7 + type: b1 + - id: load + type: b1 + view: + seq: + - id: flag + type: view_flag + doc: VIEW/70 + - id: view_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + - id: view_size + type: f8 + doc: VIEW/40 + - id: center_point + type: point_2d + doc: VIEW/10|20 + - id: view_width + type: f8 + doc: VIEW/41 + - id: view_dir + type: point_3d + doc: VIEW/11|21|31 + - id: u3 + type: s2 + - id: u4 + size: 58 + view_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + ucs: + seq: + - id: flag + type: ucs_flag + doc: UCS/70 + - id: ucs_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: UCS/2 + - id: ucs_org + type: point_3d + doc: UCS/10|20|30 + - id: ucs_x_dir + type: point_3d + doc: UCS/11|21|31 + - id: ucs_y_dir + type: point_3d + doc: UCS/12|22|32 + ucs_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + vport: + seq: + - id: flag + type: vport_flag + doc: VPORT/70 + - id: vport_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: VPORT/2 + - id: view_size_vport_10_20 + type: point_2d + doc: VPORT/10|20, TODO + - id: view_ctrl_vport_11_21 + type: point_2d + doc: VPORT/11|21 + - id: view_taget_vport_17_27_37 + type: point_3d + doc: VPORT/17|27|37 + - id: vport_16_26_36 + type: point_3d + doc: VPORT/16|26|36 + - id: vport_51_in_radians + type: f8 + doc: VPORT/51 + - id: vport_40 + type: f8 + doc: VPORT/40 + - id: vport_12_22 + type: point_2d + doc: VPORT/12|22 + - id: vport_41 + type: f8 + doc: VPORT/41 + - id: vport_42 + type: f8 + doc: VPORT/42 + - id: vport_43 + type: f8 + doc: VPORT/43 + - id: vport_44 + type: f8 + doc: VPORT/44 + - id: vport_71 + type: u2 + doc: VPORT/71 + - id: vport_72 + type: u2 + doc: VPORT/72 + - id: vport_73 + type: u2 + doc: VPORT/73 + - id: vport_74 + type: u2 + doc: VPORT/74 + - id: vport_75 + type: u2 + doc: VPORT/75 + - id: vport_76 + type: u2 + doc: VPORT/76 + - id: vport_77 + type: u2 + doc: VPORT/77 + - id: vport_78 + type: u2 + doc: VPORT/78 + - id: u14 + type: f8 + - id: u15 + type: f8 + - id: u16 + type: f8 + - id: vport_14_24 + type: point_2d + doc: VPORT/14|24 + - id: vport_15_25 + type: point_2d + doc: VPORT/15|25 + vport_flag: + seq: + - id: deleted + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + appid: + seq: + - id: flag + type: appid_flag + doc: APPID/70 + - id: appid_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: APPID/2 + appid_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + generation_flags: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: upside_down + type: b1 + - id: backwards + type: b1 + - id: flag8 + type: b1 + point_2d: + seq: + - id: x + type: f8 + - id: y + type: f8 + point_3d: + seq: + - id: x + type: f8 + - id: y + type: f8 + - id: z + type: f8 +enums: + entities: + 1: line + 2: point + 3: circle + 4: shape + # NOT_USED 5: repeat_begin + # NOT_USED 6: repeat_end + 7: text + 8: arc + 9: trace + # NOT_USED 10: load + 11: solid + 12: block_begin + 13: block_end + 14: insert + 15: attdef + 16: attrib + 17: seqend + 18: polyline + 19: polyline2 + 20: vertex + 21: line3d + 22: face3d + 23: dim + osnap_modes: + 0: none + 1: endpoint + 2: midpoint + 4: center + 8: node + 16: quadrant + 32: intersection + 64: insertion + 128: perpendicular + 256: tangent + 512: nearest + unit_types: + 1: scientific + 2: decimal + 3: engineering + 4: architectural + 5: fractional + units_for_angles: + 0: decimal_degrees + 1: degrees_minutes_seconds + 2: gradians + 3: radians + 4: surveyor_s_units + angle_direction: + 0: counterclockwise + 1: clockwise + limits_check: + 0: objects_can_outside_grid + 1: objects_cannot_outside_grid + coordinates: + 0: absolute_coordinates + 1: absolute_coordinates_realtime + 2: relative_polar_coordinates + attributes: + 0: off + 1: normal + 2: on + current_color: + 0: byblock + 1: red + 2: yellow + 3: green + 4: cyan + 5: blue + 6: magenta + 7: white + 256: bylayer + iso_plane: + 0: left + 1: top + 2: right + text_type: + 1: center + 2: end + 3: aligned + 4: middle + 5: fit + spline_type: + 5: quadratic_b_spline + 6: cubic_b_spline diff --git a/dwg_ac1009.ksy b/dwg_ac1009.ksy new file mode 100644 index 0000000..97cc14d --- /dev/null +++ b/dwg_ac1009.ksy @@ -0,0 +1,1602 @@ +meta: + id: dwg_ac1009 + title: AutoCAD drawing (AC1009) + application: AutoCAD + file-extension: + - dwg + license: CC0-1.0 + xref: + justsolve: DWG + pronom: + fmt: 32 + mime: + - application/x-dwg + - image/vnd.dwg + wikidata: Q27863127 + endian: le +seq: + - id: header + type: header + - id: entities + type: real_entities + size: header.entities_end - header.entities_start + - id: blocks + type: block + repeat: expr + repeat-expr: header.table_block.items + - id: layers + type: layer + repeat: expr + repeat-expr: header.table_layer.items +# - id: styles +# type: style +# repeat: expr +# repeat-expr: header.table_style.items +# - id: linetypes +# type: linetype +# repeat: expr +# repeat-expr: header.table_linetype.items +# - id: views +# type: view +# repeat: expr +# repeat-expr: header.table_view.items +# - id: block_entities +# type: real_entities +# size: header.blocks_size +# - id: ucss +# type: ucs +# repeat: expr +# repeat-expr: header.variables.table_ucs.items +# - id: vports +# type: vport +# repeat: expr +# repeat-expr: header.variables.table_vport.items +# - id: appids +# type: appid +# repeat: expr +# repeat-expr: header.variables.table_appid.items + - id: todo + size-eos: true + repeat: eos + if: not _io.eof +types: + block: + seq: + - id: flag + type: block_flag + doc: BLOCK/70 + - id: block_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: BLOCK/2 + - id: u2 + type: s1 + - id: u3 + type: s1 + - id: u4 + type: s1 + - id: u5 + type: s1 + - id: u6 + type: f8 + block_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + header: + seq: + - id: magic + contents: [0x41, 0x43, 0x31, 0x30, 0x30, 0x39] + doc: 0x0000-0x0005, $ACADVER + - id: zeros + size: 6 + - id: zero_one_or_three + type: s1 + - id: unknown_3 + type: s2 + - id: num_sections + type: s2 + - id: num_header_vars + type: s2 + - id: dwg_version + type: s1 + - id: entities_start + type: s4 + - id: entities_end + type: s4 + - id: blocks_start + type: s4 + - id: blocks_size_raw + type: u4 + - id: blocks_end + type: s4 + - id: unknown4b + size: 2 + - id: unknown4c + size: 2 + - id: table_block + type: table + - id: table_layer + type: table + - id: table_style + type: table + - id: table_linetype + type: table + - id: table_view + type: table + - id: variables + type: header_variables + instances: + blocks_size_unknown: + value: (blocks_size_raw & 0xff000000) >> 24 + blocks_size: + value: (blocks_size_raw & 0x00ffffff) + table: + seq: + - id: item_size + type: u2 + - id: items + type: u2 + - id: unknown + size: 2 + - id: begin + type: u4 + header_variables: + seq: + - id: insertion_base + type: point_3d + doc: 0x005e-0x0075, $INSBASE/10|20|30 + - id: plinegen + type: s2 + doc: 0x0076-0x0077, $PLINEGEN/70 + - id: drawing_first + type: point_3d + doc: 0x0078-0x008f, $EXTMIN/10|20|30 + - id: drawing_second + type: point_3d + doc: 0x0090-0x00a7, $EXTMAX/10|20|30 + - id: limits_min + type: point_2d + doc: 0x00a8-0x00b7, $LIMMIN/10|20 + - id: limits_max + type: point_2d + doc: 0x00b8-0x00c7, $LIMMAX/10|20 + - id: view_ctrl + type: point_3d + doc: 0x00c8-0x00da, $VIEWCTRL/10|20|30 + - id: view_size + type: f8 + doc: 0x00e0-0x00e7 + - id: snap + type: s2 + doc: 0x00e8-0x00e9, $SNAPMODE + - id: snap_resolution + type: point_2d + doc: 0x00ea-0x00f9, $SNAPUNIT/10|20 + - id: snap_base + type: point_2d + doc: 0x00fa-0x0109, $SNAPBASE/10|20 + - id: snap_angle + type: f8 + doc: 0x010a-0x0111, $SNAPANG + - id: snap_style + type: s2 + doc: 0x0112-0x0113, $SNAPSTYLE + - id: snap_iso_pair + type: s2 + enum: iso_plane + doc: 0x0114-0x0115, $SNAPISOPAIR + - id: grid + type: s2 + doc: 0x0116-0x0117, $GRIDMODE + - id: grid_unit + type: point_2d + doc: 0x0118-0x0127, $GRIDUNIT/10|20 + - id: ortho + type: s2 + doc: 0x0128-0x0129, $ORTHOMODE + - id: regen + type: s2 + doc: 0x012a-0x012b, $REGENMODE + - id: fill + type: s2 + doc: 0x012c-0x012d, $FILLMODE + - id: qtext + type: s2 + doc: 0x012e-0x012f, $QTEXTMODE + - id: drag + type: s2 + doc: 0x0130-0x0131, $DRAGMODE + - id: linetype_scale + type: f8 + doc: 0x0132-0x0139, $LTSCALE + - id: text_size + type: f8 + doc: 0x013a-0x0141, $TEXTSIZE + - id: trace_width + type: f8 + doc: 0x0142-0x0149, $TRACEWID + - id: current_layer_index + type: s2 + doc: 0x014a-0x014b, $CLAYER + - id: current_color_convert + type: s2 + doc: 0x014c-0x014d, (2, 3, 8, 15 - default) + - id: unknown6 + type: f8 + doc: 0x014e-0x0155 + - id: psltscale + type: u2 + doc: 0x0156-0x0157, $PSLTSCALE/70 + - id: unknown7c + size: 2 + doc: 0x0158-0x0159 + - id: unknown7d + size: 2 + doc: 0x015a-0x015b + - id: unknown8 + type: f8 + doc: 0x015c-0x0163 + - id: linear_units_format + enum: unit_types + type: s2 + doc: 0x0164-0x0165, $LUNITS + - id: linear_units_precision + type: s2 + doc: 0x0166-0x0167, $LUPREC + - id: axis + type: s2 + doc: 0x0168-0x0169, $AXISMODE/70 + - id: axis_value + type: point_2d + doc: 0x016a-0x0179, $AXISUNIT/10|20 + - id: sketch_increment + type: f8 + doc: 0x017a-0x0181, $SKETCHINC + - id: fillet_radius + type: f8 + doc: $FILETRAD + - id: units_for_angles + enum: units_for_angles + type: s2 + doc: $AUNITS + - id: angular_precision + type: s2 + doc: $AUPREC + - id: text_style_index + type: s2 + doc: 0x018e-0x018f, $TEXTSTYLE (index) + - id: osnap + enum: osnap_modes + type: s2 + doc: 0x0190-0x0191, $OSMODE + - id: attributes + enum: attributes + type: s2 + doc: 0x0192-0x0193, $ATTMODE + - id: menu + size: 15 + type: str + encoding: ASCII + terminator: 0x00 + doc: 0x0194-0x01a2, $MENU + - id: dim_scale + type: f8 + doc: 0x01a3-0x01aa, $DIMSCALE + - id: dim_arrowhead_size + type: f8 + doc: $DIMASZ + - id: dim_extension_line_offset + type: f8 + doc: $DIMEXO + - id: dim_baseline_spacing + type: f8 + doc: $DIMDLI + - id: dim_extension_line_extend + type: f8 + doc: $DIMEXE + - id: dim_maximum_tolerance_limit + type: f8 + doc: 0x01cb-0x01d2, $DIMTP + - id: dim_minimum_tolerance_limit + type: f8 + doc: 0x01d3-0x01da, $DIMTM + - id: dim_text_height + type: f8 + doc: 0x01db-0x01e2, $DIMTXT + - id: dim_center_mark_control + type: f8 + doc: 0x01e3-0x01ea, $DIMCEN + - id: dim_oblique_stroke_size + type: f8 + doc: 0x01eb-0x01f2, $DIMTSZ + - id: dim_tolerances + type: s1 + doc: 0x01f3, $DIMTOL + - id: dim_limits_default_text + type: s1 + doc: 0x01f4, $DIMLIM + - id: dim_text_ext_inside_line_position + type: s1 + doc: 0x01f5, $DIMTIH + - id: dim_text_ext_outside_line_position + type: s1 + doc: 0x01f6, $DIMTOH + - id: dim_extension_line_first_suppress + type: s1 + doc: 0x01f7, $DIMSE1 + - id: dim_extension_line_second_suppress + type: s1 + doc: 0x01f8, $DIMSE2 + - id: dim_text_vertical_position + type: s1 + doc: 0x01f9, $DIMTAD + - id: limits_check + enum: limits_check + type: s2 + doc: 0x01fa-0x01fb, $LIMCHECK + - id: unknown10 + size: 45 + - id: elevation + type: f8 + doc: 0x0229-0x0230, $ELEVATION + - id: thickness + type: f8 + doc: 0x0231-0x0238, $THICKNESS + - id: view_point + type: point_3d + doc: 0x0239-0x0251, $VIEWDIR/10|20|30 + - id: unknown11 + type: f8 + - id: unknown12 + type: f8 + - id: unknown13 + type: f8 + - id: unknown14 + type: f8 + - id: unknown15 + type: f8 + - id: unknown16 + type: f8 + - id: unknown17 + type: f8 + - id: unknown18 + type: f8 + - id: unknown19 + type: f8 + - id: unknown20 + type: f8 + - id: unknown21 + type: f8 + - id: unknown22 + type: f8 + - id: unknown23 + type: f8 + - id: unknown24 + type: f8 + - id: unknown25 + type: f8 + - id: unknown26 + type: f8 + - id: unknown27 + type: f8 + - id: unknown28 + type: f8 + - id: unknown29 + size: 2 + - id: blip + type: s1 + doc: 0x02e3, $BLIPMODE, TODO s1 or s2? + - id: unknown29a + size: 1 + - id: dim_suppression_of_zeros + type: s1 + doc: 0x02e5, $DIMZIN + - id: dim_rounding + type: f8 + doc: 0x02e6-0x02ed, $DIMRND + - id: dim_extension_line_extend2 + type: f8 + doc: 0x02ee-0x02f5, $DIMDLE + - id: dim_arrowhead_block + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMBLK + - id: unknown30 + type: s1 + - id: circle_zoom_percent + type: s2 + doc: 0x0317-0x0318 + - id: coordinates + enum: coordinates + type: s2 + doc: 0x0319-0x031a, $COORDS + - id: current_color + enum: current_color + type: s2 + doc: 256d - bylayer, 0d - byblock, other index (1-255), $CECOLOR + - id: current_linetype + type: s2 + doc: 256d - bylayer, 255d - byblock, other index, $CELTYPE + - id: create_date_days + type: u4 + doc: $TDCREATE/days + - id: create_date_ms + type: u4 + doc: $TDCREATE/ms + - id: update_date_days + type: u4 + doc: $TDUPDATE/days + - id: update_date_ms + type: u4 + doc: $TDUPDATE/ms + - id: total_editing_time_days + type: u4 + doc: $TDINDWG/days + - id: total_editing_time_ms + type: u4 + doc: $TDINDWG/ms + - id: user_elapsed_timer_days + type: u4 + doc: $TDUSRTIMER/days + - id: user_elapsed_timer_ms + type: u4 + doc: $TDUSRTIMER/ms + - id: user_timer + type: s2 + doc: 0x033f-0x0340, $USRTIMER + - id: fast_zoom + type: s1 + doc: 0x0341, $FASTZOOM + - id: unknown33 + size: 1 + - id: sketch_type + type: s1 + doc: 0x0343, $SKPOLY + - id: unknown33b + size: 7 + - id: unknown34 + type: f8 + - id: angle_base + type: f8 + doc: 0x0353-0x035a, $ANGBASE + - id: angle_direction + enum: angle_direction + type: s2 + doc: 0x035b-0x035c, $ANGDIR + - id: point_mode + type: s2 + doc: 0x035d-0x035e, $PDMODE + - id: point_size + type: f8 + doc: $PDSIZE + - id: polyline_width + type: f8 + doc: $PLINEWID + - id: user_integer_1 + type: s2 + doc: 0x035f-0x0360, $USERI1 + - id: user_integer_2 + type: s2 + doc: 0x0361-0x0362, $USERI2 + - id: user_integer_3 + type: s2 + doc: 0x0363-0x0364, $USERI3 + - id: user_integer_4 + type: s2 + doc: 0x0365-0x0366, $USERI4 + - id: user_integer_5 + type: s2 + doc: 0x0367-0x0368, $USERI5 + - id: user_real_1 + type: f8 + doc: $USERR1 + - id: user_real_2 + type: f8 + doc: $USERR2 + - id: user_real_3 + type: f8 + doc: $USERR3 + - id: user_real_4 + type: f8 + doc: $USERR4 + - id: user_real_5 + type: f8 + doc: $USERR5 + - id: dim_alternate_units + type: s1 + doc: 0x03a1, $DIMALT + - id: dim_alternate_units_decimal_places + type: s1 + doc: 0x03a2, $DIMALTD + - id: dim_associative + type: s1 + doc: 0x03a3, $DIMASO + - id: dim_sho + type: s1 + doc: 0x03a4, $DIMSHO + - id: dim_measurement_postfix + size: 16 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMPOST, TODO And prefix? + - id: dim_alternate_measurement_postfix + size: 16 + type: str + encoding: ASCII + terminator: 0x00 + doc: $DIMAPOST, TODO And prefix + - id: dim_alternate_units_multiplier + type: f8 + doc: 0x03c5-0x03cc, $DIMALTF + - id: dim_linear_measurements_scale_factor + type: f8 + doc: 0x03cd-0x03d4, $DIMLFAC + - id: spline_segs + type: s2 + doc: 0x03d5-0x03d6, $SPLINESEGS + - id: spline_frame + type: s2 + doc: 0x03d7-0x03d8, $SPLFRAME + - id: unknown31b + type: s2 + - id: unknown31c + type: s2 + - id: chamfera + type: f8 + doc: $CHAMFERA/40 + - id: chamferb + type: f8 + doc: $CHAMFERB/40 + - id: mirror_text + type: s2 + doc: 0x03ed-0x03ee, $MIRRTEXT + - id: table_ucs + type: table + - id: unknown37 + size: 2 + - id: ucs_origin_point + type: point_3d + doc: $UCSORG/10|20|30 + - id: ucs_x_dir + type: point_3d + doc: $UCSXDIR/11|21|31 ~ $UCSXORI + - id: ucs_y_dir + type: point_3d + doc: $UCSYDIR/12|22|32 ~ $UCSYORI + - id: unknown38 + type: f8 + - id: unknown39 + type: f8 + - id: unknown40 + type: f8 + - id: unknown41 + type: f8 + - id: unknown42 + size: 26 + - id: unknown43 + type: u1 + doc: 0x047d, TODO libredwg DIMTOFL + - id: unknown44 + size: 130 + - id: table_vport + type: table + - id: unknown45 + type: u2 + - id: spline_type + type: u2 + doc: 0x050c-0x050d, $SPLINETYPE + - id: unknown46 + type: u2 + - id: unknown47 + type: u2 + - id: table_appid + type: table + doc: 0x0512-0x051c + - id: unknown48 + type: u2 + - id: unknown49 + size: 433 + instances: + create_date: + value: create_date_days + (create_date_ms / 86400000.0) + update_date: + value: update_date_days + (update_date_ms / 86400000.0) + entity: + seq: + - id: entity_type + type: s1 + enum: entities + - id: data + type: + switch-on: entity_type + cases: + 'entities::arc': entity_arc + 'entities::attdef': entity_attdef + 'entities::block_begin': entity_block_begin + 'entities::block_end': entity_block_end + 'entities::insert' : entity_insert + 'entities::circle': entity_circle + 'entities::dim': entity_dim + 'entities::face3d': entity_face3d + 'entities::line': entity_line + 'entities::point': entity_point + 'entities::polyline': entity_polyline + 'entities::polyline2': entity_polyline + 'entities::seqend': entity_seqend + 'entities::shape': entity_shape + 'entities::solid': entity_solid + 'entities::text': entity_text + 'entities::trace': entity_trace + 'entities::vertex': entity_vertex + _: entity_tmp + entity_mode: + seq: + - id: entity_mode1 + type: b1 + - id: entity_mode2 + type: b1 + - id: entity_mode3 + type: b1 + - id: entity_mode4 + type: b1 + - id: entity_thickness_flag + type: b1 + - id: entity_elevation_flag + type: b1 + - id: entity_linetype_flag + type: b1 + - id: entity_color_flag + type: b1 + entity_common: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: entity_layer_index + type: s1 + - id: flag1 + type: s1 + - id: flag2_1 + type: b1 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_6 + type: b1 + - id: flag2_7 + type: b1 + - id: flag2_8 + type: b1 + - id: flag3_1 + type: b1 + - id: flag3_2 + type: b1 + - id: flag3_3 + type: b1 + - id: flag3_4 + type: b1 + - id: flag3_5 + type: b1 + - id: flag3_6 + type: b1 + - id: flag3_7 + type: b1 + - id: flag3_8 + type: b1 + - id: entity_color + type: s1 + if: entity_mode.entity_color_flag + - id: entity_linetype_index + type: s1 + if: entity_mode.entity_linetype_flag + - id: entity_thickness + type: f8 + if: entity_mode.entity_thickness_flag + entity_arc: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: ARC/10 + - id: y + type: f8 + doc: ARC/20 + - id: radius + type: f8 + doc: ARC/40 + - id: angle_from + type: f8 + doc: ARC/50 + - id: angle_to + type: f8 + doc: ARC/51 + entity_attdef: + seq: + - id: entity_common + type: entity_common + - id: start_point + type: point_2d + doc: ATTDEF/10|20 + - id: height + type: f8 + doc: ATTDEF/40 + - id: default_size + type: s2 + - id: default + size: default_size + doc: ATTDEF/1 + - id: prompt_size + type: s2 + - id: prompt + size: prompt_size + doc: ATTDEF/3 + - id: tag_size + type: s2 + - id: tag + size: tag_size + doc: ATTDEF/2 + - id: flags + type: attdef_flags + doc: ATTDEF/70 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_7 + doc: ATTDEF/50 + - id: width_scale_factor + type: f8 + if: entity_common.flag2_6 + doc: ATTDEF/41 + - id: unknown_index + type: u1 + if: entity_common.flag2_4 + - id: flags2 + type: attdef_flags2 + if: entity_common.flag2_2 + doc: ATTDEF/72 + - id: end_point + type: point_2d + if: entity_common.flag2_1 + doc: ATTDEF/11|21 + entity_block_begin: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + entity_block_end: + seq: + - id: entity_common + type: entity_common + entity_insert: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + doc: INSERT/2 + - id: x + type: f8 + doc: INSERT/10 + - id: y + type: f8 + doc: INSERT/20 + - id: x_scale + type: f8 + if: entity_common.flag2_8 + doc: INSERT/41 + - id: y_scale + type: f8 + if: entity_common.flag2_7 + doc: INSERT/42 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_6 + doc: INSERT/50 + - id: z_scale + type: f8 + if: entity_common.flag2_5 + doc: INSERT/43 + - id: columns + type: u2 + if: entity_common.flag2_4 + doc: INSERT/70 + - id: rows + type: u2 + if: entity_common.flag2_3 + doc: INSERT/71 + - id: column_spacing + type: f8 + if: entity_common.flag2_2 + doc: INSERT/44 + - id: row_spacing + type: f8 + if: entity_common.flag2_1 + doc: INSERT/45 + entity_circle: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: CIRCLE/10 + - id: y + type: f8 + doc: CIRCLE/20 + - id: radius + type: f8 + doc: CIRCLE/40 + entity_dim: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + - id: dimension_line_defining_point + type: point_2d + doc: DIMENSION/10|20 + - id: dimension_line_defining_point_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false + doc: DIMENSION/30 + - id: default_text_position + type: point_2d + doc: DIMENSION/11|21 +# - id: default_text_position_z +# type: f8 +# if: entity_common.entity_mode.entity_elevation_flag == false +# doc: DIMENSION/31 + - id: unknown1 + type: u1 + if: entity_common.flag2_7 + doc: DIMENSION/70 + - id: text_size + type: s2 + if: entity_common.flag2_6 + - id: text + size: text_size + if: entity_common.flag2_6 + doc: DIMENSION/1 + - id: extension_defining_point1 + type: point_2d + if: entity_common.flag2_5 + doc: DIMENSION/13|23 + - id: extension_defining_point1_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false and entity_common.flag2_5 + doc: DIMENSION/33 + - id: extension_defining_point2 + type: point_2d + if: entity_common.flag2_4 + doc: DIMENSION/14|24 + - id: extension_defining_point2_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false and entity_common.flag2_4 + doc: DIMENSION/34 + - id: defining_point + type: point_2d + if: entity_common.flag2_3 + doc: DIMENSION/15|25 + - id: defining_point_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false and entity_common.flag2_3 + doc: DIMENSION/35 + - id: dimension_line_arc_definition_point + type: point_2d + if: entity_common.flag2_2 + - id: dimension_line_arc_definition_point_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false and entity_common.flag2_2 + - id: unknown2 + type: point_2d + if: entity_common.flag2_1 + - id: unknown2_z + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false and entity_common.flag2_1 + - id: rotation_in_radians + type: f8 + if: entity_common.flag3_8 + entity_face3d: + seq: + - id: entity_common + type: entity_common + entity_line: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: LINE/10 + - id: y1 + type: f8 + doc: LINE/20 + - id: z1 + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false + doc: LINE/30 + - id: x2 + type: f8 + doc: LINE/11 + - id: y2 + type: f8 + doc: LINE/21 + - id: z2 + type: f8 + if: entity_common.entity_mode.entity_elevation_flag == false + doc: LINE/31 + entity_tmp: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: entity_layer_index + type: s1 + - id: flag1 + type: s1 + - id: flag2_1 + type: b1 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_6 + type: b1 + - id: flag2_7 + type: b1 + - id: flag2_8 + type: b1 + - id: flag3_1 + type: b1 + - id: flag3_2 + type: b1 + - id: flag3_3 + type: b1 + - id: flag3_4 + type: b1 + - id: flag3_5 + type: b1 + - id: flag3_6 + type: b1 + - id: flag3_7 + type: b1 + - id: flag3_8 + type: b1 + - id: xxx + size: entity_size - 8 + entity_point: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: POINT/10 + - id: y + type: f8 + doc: POINT/20 + entity_polyline: + seq: + - id: entity_common + type: entity_common + - id: closed + type: u1 + if: entity_common.flag2_8 + doc: POLYLINE/66 + - id: x + type: f8 + if: entity_common.flag2_7 + doc: POLYLINE/40 + - id: y + type: f8 + if: entity_common.flag2_6 + doc: POLYLINE/41 + entity_seqend: + seq: + - id: entity_common + type: entity_common + - id: unknown + size: 4 + entity_shape: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: item_num + type: u1 + - id: angle + type: f8 + if: entity_common.flag2_8 + - id: load_num + type: u1 + entity_solid: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_text: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: size + type: s2 + - id: value + size: size + - id: angle + type: f8 + if: entity_common.flag2_8 + entity_trace: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_vertex: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: VERTEX/10 + - id: y + type: f8 + doc: VERTEX/20 + - id: width + type: f8 + if: entity_common.flag2_8 + - id: bulge + type: f8 + if: entity_common.flag2_6 + doc: VERTEX/42 + - id: unknown_in_radians + type: f8 + if: entity_common.flag2_4 + doc: VERTEX/50 + attdef_flags: + seq: + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: invisible + type: b1 + - id: constant + type: b1 + - id: verify + type: b1 + attdef_flags2: + seq: +## TODO Tohle je divne + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: middle + type: b1 + - id: right + type: b1 + - id: center + type: b1 + layer: + seq: + - id: flag + type: layer_flag + doc: LAYER/70 + - id: layer_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LAYER/2 + - id: color + type: s2 + doc: LAYER/62 + - id: linetype_index + type: u2 + doc: LAYER/6 + - id: unknown3 + type: s1 + - id: unknown4 + type: s1 + - id: unknown5 + type: u2 + layer_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + linetype: + seq: + - id: flag + type: linetype_flag + doc: LTYPE/70 + - id: linetype_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/2 + - id: description + size: 48 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/3 + - id: alignment + type: u1 + doc: LTYPE/72 + - id: num_dashes + type: u1 + doc: LTYPE/73 + - id: pattern_len + type: f8 + doc: LTYPE/40 + - id: pattern + type: pattern + doc: LTYPE/49 + - id: unknown + type: s1 + pattern: + seq: + - id: pattern1 + type: f8 + - id: pattern2 + type: f8 + - id: pattern3 + type: f8 + - id: pattern4 + type: f8 + - id: pattern5 + type: f8 + - id: pattern6 + type: f8 + - id: pattern7 + type: f8 + - id: pattern8 + type: f8 + - id: pattern9 + type: f8 + linetype_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + real_entities: + seq: + - id: entities + type: entity + repeat: eos + style: + seq: + - id: flag1_1 + type: b1 + - id: flag1_2 + type: b1 + - id: flag1_3 + type: b1 + - id: flag1_4 + type: b1 + - id: flag1_5 + type: b1 + - id: flag1_vertical + type: b1 + - id: flag1_7 + type: b1 + - id: flag1_8 + type: b1 + - id: text + size: 31 + type: str + encoding: ASCII + terminator: 0x2e + - id: height + type: f8 + doc: STYLE/40 + - id: unknown1 + type: u1 + - id: width_factor + type: f8 + doc: STYLE/41 + - id: obliquing_angle_in_radians + type: f8 + doc: STYLE/50 + - id: flag2_1 + type: b1 + doc: STYLE/71 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_upside_down + type: b1 + - id: flag2_backwards + type: b1 + - id: flag2_8 + type: b1 + - id: u12 + type: f8 + doc: STYLE/42 + - id: font_file + size: 90 + - id: u13 + size: 38 + view: + seq: + - id: u1 + size: 4 + - id: view_name + size: 31 + type: str + encoding: ASCII + terminator: 0x2e + - id: u2 + type: u1 + - id: view_size + type: f8 + doc: VIEW/40 + - id: center_point + type: point_2d + doc: VIEW/10|20 + - id: view_width + type: f8 + doc: VIEW/41 + - id: view_dir + type: point_3d + doc: VIEW/11|21|31 + - id: u3 + type: s2 + - id: u4 + size: 58 + ucs: + seq: + - id: flag + type: ucs_flag + doc: UCS/70 + - id: ucs_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: UCS/2 + - id: ucs_org + type: point_3d + doc: UCS/10|20|30 + - id: ucs_x_dir + type: point_3d + doc: UCS/11|21|31 + - id: ucs_y_dir + type: point_3d + doc: UCS/12|22|32 + ucs_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + vport: + seq: + - id: flag + type: vport_flag + doc: VPORT/70 + - id: vport_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: VPORT/2 + - id: view_size_vport_10_20 + type: point_2d + doc: VPORT/10|20, TODO + - id: view_ctrl_vport_11_21 + type: point_2d + doc: VPORT/11|21 + - id: view_taget_vport_17_27_37 + type: point_3d + doc: VPORT/17|27|37 + - id: vport_16_26_36 + type: point_3d + doc: VPORT/16|26|36 + - id: vport_51_in_radians + type: f8 + doc: VPORT/51 + - id: vport_40 + type: f8 + doc: VPORT/40 + - id: vport_12_22 + type: point_2d + doc: VPORT/12|22 + - id: vport_41 + type: f8 + doc: VPORT/41 + - id: vport_42 + type: f8 + doc: VPORT/42 + - id: vport_43 + type: f8 + doc: VPORT/43 + - id: vport_44 + type: f8 + doc: VPORT/44 + - id: vport_71 + type: u2 + doc: VPORT/71 + - id: vport_72 + type: u2 + doc: VPORT/72 + - id: vport_73 + type: u2 + doc: VPORT/73 + - id: vport_74 + type: u2 + doc: VPORT/74 + - id: vport_75 + type: u2 + doc: VPORT/75 + - id: vport_76 + type: u2 + doc: VPORT/76 + - id: vport_77 + type: u2 + doc: VPORT/77 + - id: vport_78 + type: u2 + doc: VPORT/78 + - id: u14 + type: f8 + - id: u15 + type: f8 + - id: u16 + type: f8 + - id: vport_14_24 + type: point_2d + doc: VPORT/14|24 + - id: vport_15_25 + type: point_2d + doc: VPORT/15|25 + vport_flag: + seq: + - id: deleted + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + appid: + seq: + - id: flag + type: appid_flag + doc: APPID/70 + - id: appid_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: APPID/2 + appid_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + point_2d: + seq: + - id: x + type: f8 + - id: y + type: f8 + point_3d: + seq: + - id: x + type: f8 + - id: y + type: f8 + - id: z + type: f8 +enums: + entities: + 1: line + 2: point + 3: circle + 4: shape + # NOT_USED 5: repeat_begin + # NOT_USED 6: repeat_end + 7: text + 8: arc + 9: trace + # NOT_USED 10: load + 11: solid + 12: block_begin + 13: block_end + 14: insert + 15: attdef + # 16 TODO attrib + 17: seqend + 18: polyline + 19: polyline2 + 20: vertex + # NOT_USED 21: line3d + 22: face3d + 23: dim + osnap_modes: + 0: none + 1: endpoint + 2: midpoint + 4: center + 8: node + 16: quadrant + 32: intersection + 64: insertion + 128: perpendicular + 256: tangent + 512: nearest + unit_types: + 1: scientific + 2: decimal + 3: engineering + 4: architectural + 5: fractional + units_for_angles: + 0: decimal_degrees + 1: degrees_minutes_seconds + 2: gradians + 3: radians + 4: surveyor_s_units + angle_direction: + 0: counterclockwise + 1: clockwise + limits_check: + 0: objects_can_outside_grid + 1: objects_cannot_outside_grid + coordinates: + 0: absolute_coordinates + 1: absolute_coordinates_realtime + 2: relative_polar_coordinates + attributes: + 0: off + 1: normal + 2: on + current_color: + 0: byblock + 1: red + 2: yellow + 3: green + 4: cyan + 5: blue + 6: magenta + 7: white + 256: bylayer + iso_plane: + 0: left + 1: top + 2: right diff --git a/dwg_ac1_2.ksy b/dwg_ac1_2.ksy new file mode 100644 index 0000000..8cdf65c --- /dev/null +++ b/dwg_ac1_2.ksy @@ -0,0 +1,345 @@ +meta: + id: dwg_0120 + title: AutoCAD drawing (AC1.2) + application: AutoCAD + file-extension: + - dwg + license: CC0-1.0 + xref: + justsolve: DWG + pronom: + fmt: 22 + mime: + - application/x-dwg + - image/vnd.dwg + wikidata: Q27863107 + endian: le +seq: + - id: header + type: header + - id: entities + type: entity + repeat: expr + repeat-expr: header.number_of_entities +types: + header: + seq: + - id: magic + contents: [0x41, 0x43, 0x31, 0x2e, 0x32, 0x00] + - id: zeros + size: 6 + - id: insertion_base + type: point_3d + doc: 0x000c-0x0023 + - id: number_of_bytes + type: s4 + - id: number_of_entities + type: s2 + doc: 0x0028-0x0029 + - id: drawing_first + type: point_3d + - id: drawing_second + type: point_3d + - id: limits_min + type: point_2d + doc: 0x005a-0x0069 + - id: limits_max + type: point_2d + doc: 0x006a-0x0079 + - id: view_ctrl + type: point_3d + - id: view_size + type: f8 + - id: snap + type: s2 + doc: 0x009a-0x009b + - id: snap_resolution + type: f8 + doc: 0x009c-0x00a3 + - id: grid + type: s2 + doc: 0x00a4-0x00a5 + - id: grid_unit + type: f8 + doc: 0x00a6-0x00ad + - id: ortho + type: s2 + doc: 0x00ae-0x00af + - id: regen + type: s2 + doc: 0x00b0-0x00b1 (XXX could be ffff) + - id: fill + type: s2 + doc: 0x00b2-0x00b3 (XXX could be ffff) + - id: text_size + type: f8 + - id: trace_width + type: f8 + - id: current_layer + type: s2 + doc: 0x00c4-0x00c5 + - id: current_color + type: s2 + doc: 0x00c6-0x00c7 + - id: unknown1 + type: s2 + doc: 0x00c8-0x00c9 + - id: layers + type: s2 + repeat: expr + repeat-expr: 127 + doc: 0x00ca-0x01c7 + - id: dim_arrowsize + type: f8 + doc: 0x01c8-0x01cf + - id: unknown2 + type: f8 + doc: 0x01d0-0x01d7 + entity: + seq: + - id: entity_type + type: s2 + enum: entities + - id: data + type: + switch-on: entity_type + cases: + 'entities::arc': entity_arc + 'entities::block_begin': entity_block_begin + 'entities::block_end': entity_block_end + 'entities::block_insert' : entity_block_insert + 'entities::circle': entity_circle + 'entities::line': entity_line + 'entities::load': entity_load + 'entities::point': entity_point + 'entities::repeat_begin': entity_repeat_begin + 'entities::repeat_end': entity_repeat_end + 'entities::shape': entity_shape + 'entities::solid': entity_solid + 'entities::text': entity_text + 'entities::trace': entity_trace + 'entities::tmp_arc': entity_arc + 'entities::tmp_block_insert' : entity_block_insert + 'entities::tmp_circle': entity_circle + 'entities::tmp_line': entity_line + 'entities::tmp_point': entity_point + 'entities::tmp_shape': entity_shape + 'entities::tmp_solid': entity_solid + 'entities::tmp_text': entity_text + 'entities::tmp_trace': entity_trace + entity_arc: + seq: + - id: layer + type: s2 + - id: x + type: f8 + - id: y + type: f8 + - id: radius + type: f8 + - id: angle_from + type: f8 + - id: angle_to + type: f8 + entity_block_begin: + seq: + - id: layer + type: s2 + - id: size + type: s2 + - id: value + size: size + - id: x + type: f8 + - id: y + type: f8 + entity_block_end: + seq: + - id: layer + type: s2 + entity_block_insert: + seq: + - id: layer + type: s2 + - id: size + type: s2 + - id: value + size: size + - id: x + type: f8 + - id: y + type: f8 + - id: x_scale + type: f8 + - id: y_scale + type: f8 + - id: rotation_angle + type: f8 + entity_circle: + seq: + - id: layer + type: s2 + - id: x + type: f8 + - id: y + type: f8 + - id: radius + type: f8 + entity_line: + seq: + - id: layer + type: s2 + - id: x1 + type: f8 + - id: y1 + type: f8 + - id: x2 + type: f8 + - id: y2 + type: f8 + entity_load: + seq: + - id: layer + type: s2 + - id: size + type: s2 + - id: value + size: size + entity_point: + seq: + - id: layer + type: s2 + - id: x + type: f8 + - id: y + type: f8 + entity_repeat_begin: + seq: + - id: layer + type: s2 + entity_repeat_end: + seq: + - id: layer + type: s2 + - id: columns + type: s2 + - id: rows + type: s2 + - id: column_distance + type: f8 + - id: row_distance + type: f8 + entity_shape: + seq: + - id: layer + type: s2 + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: angle + type: f8 + - id: item_num + type: s2 + entity_solid: + seq: + - id: layer + type: s2 + - id: from_x + type: f8 + - id: from_y + type: f8 + - id: from_and_x + type: f8 + - id: from_and_y + type: f8 + - id: to_x + type: f8 + - id: to_y + type: f8 + - id: to_and_x + type: f8 + - id: to_and_y + type: f8 + entity_text: + seq: + - id: layer + type: s2 + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: angle + type: f8 + - id: size + type: s2 + - id: value + size: size + entity_trace: + seq: + - id: layer + type: s2 + - id: from_x + type: f8 + - id: from_y + type: f8 + - id: from_and_x + type: f8 + - id: from_and_y + type: f8 + - id: to_x + type: f8 + - id: to_y + type: f8 + - id: to_and_x + type: f8 + - id: to_and_y + type: f8 + point_2d: + seq: + - id: x + type: f8 + - id: y + type: f8 + point_3d: + seq: + - id: x + type: f8 + - id: y + type: f8 + - id: z + type: f8 +enums: + entities: + -1: tmp_line + -2: tmp_point + -3: tmp_circle + -4: tmp_shape + -7: tmp_text + -8: tmp_arc + -9: tmp_trace + -11: tmp_solid + -14: tmp_block_insert + 1: line + 2: point + 3: circle + 4: shape + 5: repeat_begin + 6: repeat_end + 7: text + 8: arc + 9: trace + 10: load + 11: solid + 12: block_begin + 13: block_end + 14: block_insert + unit_types: + 1: scientific + 2: decimal + 3: engineering + 4: architectural diff --git a/dwg_ac1_40.ksy b/dwg_ac1_40.ksy new file mode 100644 index 0000000..f0b08a9 --- /dev/null +++ b/dwg_ac1_40.ksy @@ -0,0 +1,370 @@ +meta: + id: dwg_0140 + title: AutoCAD drawing (AC1.40) + application: AutoCAD + file-extension: + - dwg + license: CC0-1.0 + xref: + justsolve: DWG + pronom: + fmt: 24 + mime: + - application/x-dwg + - image/vnd.dwg + wikidata: Q27863111 + endian: le +seq: + - id: header + type: header + - id: entities + type: entity + repeat: expr + repeat-expr: header.number_of_entities +types: + header: + seq: + - id: magic + contents: [0x41, 0x43, 0x31, 0x2e, 0x34, 0x30] + - id: zeros + size: 6 + - id: insertion_base + type: point_3d + doc: 0x000c-0x0023 + - id: number_of_bytes + type: s4 + - id: number_of_entities + type: s2 + doc: 0x0028-0x0029 + - id: drawing_first + type: point_3d + - id: drawing_second + type: point_3d + - id: limits_min + type: point_2d + doc: 0x005a-0x0069 + - id: limits_max + type: point_2d + doc: 0x006a-0x0079 + - id: view_ctrl + type: point_3d + - id: view_size + type: f8 + - id: snap + type: s2 + doc: 0x009a-0x009b + - id: snap_resolution + type: f8 + doc: 0x009c-0x00a3 + - id: grid + type: s2 + doc: 0x00a4-0x00a5 + - id: grid_unit + type: f8 + doc: 0x00a6-0x00ad + - id: ortho + type: s2 + doc: 0x00ae-0x00af + - id: regen + type: s2 + doc: 0x00b0-0x00b1 (XXX could be ffff) + - id: fill + type: s2 + doc: 0x00b2-0x00b3 (XXX could be ffff) + - id: text_size + type: f8 + - id: trace_width + type: f8 + - id: current_layer + type: s2 + doc: 0x00c4-0x00c5 + - id: current_color + type: s2 + doc: 0x00c6-0x00c7 + - id: unknown1 + type: s2 + doc: 0x00c8-0x00c9 + - id: layers + type: s2 + repeat: expr + repeat-expr: 127 + doc: 0x00ca-0x01c7 + - id: dim_arrowsize + type: f8 + doc: 0x01c8-0x01cf + - id: unknown2 + type: f8 + doc: 0x01d0-0x01d7, dim? + - id: linear_units_format + type: s2 + enum: unit_types + doc: 0x01d8-0x01d9, $LUNITS + - id: linear_units_precision + type: s2 + doc: 0x01da-0x01db, $LUPREC + - id: dim_text_within_dimension + type: s2 + doc: 0x01dc-0x01dd + - id: dim_text_outside_of_dimension + type: s2 + doc: 0x01de-0x01df + - id: axis + type: s2 + doc: 0x01e0-0x01e1 + - id: axis_value + type: point_2d + doc: 0x01e2-0x01f1 + - id: sketch_increment + type: f8 + doc: 0x01f2-0x01f9, Default value is 0.1 + - id: fillet_radius + type: f8 + doc: 0x01fa-0x0202 + entity: + seq: + - id: entity_type + type: s2 + enum: entities + - id: data + type: + switch-on: entity_type + cases: + 'entities::arc': entity_arc + 'entities::block_begin': entity_block_begin + 'entities::block_end': entity_block_end + 'entities::block_insert' : entity_block_insert + 'entities::circle': entity_circle + 'entities::line': entity_line + 'entities::load': entity_load + 'entities::point': entity_point + 'entities::repeat_begin': entity_repeat_begin + 'entities::repeat_end': entity_repeat_end + 'entities::shape': entity_shape + 'entities::solid': entity_solid + 'entities::text': entity_text + 'entities::trace': entity_trace + 'entities::tmp_arc': entity_arc + 'entities::tmp_block_insert' : entity_block_insert + 'entities::tmp_circle': entity_circle + 'entities::tmp_line': entity_line + 'entities::tmp_point': entity_point + 'entities::tmp_shape': entity_shape + 'entities::tmp_solid': entity_solid + 'entities::tmp_text': entity_text + 'entities::tmp_trace': entity_trace + entity_arc: + seq: + - id: layer + type: s2 + - id: x + type: f8 + - id: y + type: f8 + - id: radius + type: f8 + - id: angle_from + type: f8 + - id: angle_to + type: f8 + entity_block_begin: + seq: + - id: layer + type: s2 + - id: size + type: s2 + - id: value + size: size + - id: x + type: f8 + - id: y + type: f8 + entity_block_end: + seq: + - id: layer + type: s2 + entity_block_insert: + seq: + - id: layer + type: s2 + - id: size + type: s2 + - id: value + size: size + - id: x + type: f8 + - id: y + type: f8 + - id: x_scale + type: f8 + - id: y_scale + type: f8 + - id: rotation_angle + type: f8 + entity_circle: + seq: + - id: layer + type: s2 + - id: x + type: f8 + - id: y + type: f8 + - id: radius + type: f8 + entity_line: + seq: + - id: layer + type: s2 + - id: x1 + type: f8 + - id: y1 + type: f8 + - id: x2 + type: f8 + - id: y2 + type: f8 + entity_load: + seq: + - id: layer + type: s2 + - id: size + type: s2 + - id: value + size: size + entity_point: + seq: + - id: layer + type: s2 + - id: x + type: f8 + - id: y + type: f8 + entity_repeat_begin: + seq: + - id: layer + type: s2 + entity_repeat_end: + seq: + - id: layer + type: s2 + - id: columns + type: s2 + - id: rows + type: s2 + - id: column_distance + type: f8 + - id: row_distance + type: f8 + entity_shape: + seq: + - id: layer + type: s2 + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: angle + type: f8 + - id: item_num + type: s2 + entity_solid: + seq: + - id: layer + type: s2 + - id: from_x + type: f8 + - id: from_y + type: f8 + - id: from_and_x + type: f8 + - id: from_and_y + type: f8 + - id: to_x + type: f8 + - id: to_y + type: f8 + - id: to_and_x + type: f8 + - id: to_and_y + type: f8 + entity_text: + seq: + - id: layer + type: s2 + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: angle + type: f8 + - id: size + type: s2 + - id: value + size: size + entity_trace: + seq: + - id: layer + type: s2 + - id: from_x + type: f8 + - id: from_y + type: f8 + - id: from_and_x + type: f8 + - id: from_and_y + type: f8 + - id: to_x + type: f8 + - id: to_y + type: f8 + - id: to_and_x + type: f8 + - id: to_and_y + type: f8 + point_2d: + seq: + - id: x + type: f8 + - id: y + type: f8 + point_3d: + seq: + - id: x + type: f8 + - id: y + type: f8 + - id: z + type: f8 +enums: + entities: + -1: tmp_line + -2: tmp_point + -3: tmp_circle + -4: tmp_shape + -7: tmp_text + -8: tmp_arc + -9: tmp_trace + -11: tmp_solid + -14: tmp_block_insert + 1: line + 2: point + 3: circle + 4: shape + 5: repeat_begin + 6: repeat_end + 7: text + 8: arc + 9: trace + 10: load + 11: solid + 12: block_begin + 13: block_end + 14: block_insert + unit_types: + 1: scientific + 2: decimal + 3: engineering + 4: architectural diff --git a/dwg_ac1_50.ksy b/dwg_ac1_50.ksy new file mode 100644 index 0000000..e251765 --- /dev/null +++ b/dwg_ac1_50.ksy @@ -0,0 +1,1310 @@ +meta: + id: dwg_ac1_50 + title: AutoCAD drawing (AC1003) + application: AutoCAD + file-extension: + - dwg + license: CC0-1.0 + xref: + justsolve: DWG + pronom: + fmt: 25 + mime: + - application/x-dwg + - image/vnd.dwg + wikidata: Q27863113 + endian: le +seq: + - id: header + type: header + - id: entities + type: real_entities + size: header.entities_end - header.entities_start + - id: blocks + type: block + repeat: expr + repeat-expr: header.table_block.items + - id: layers + type: layer + repeat: expr + repeat-expr: header.table_layer.items + - id: styles + type: style + repeat: expr + repeat-expr: header.table_style.items + - id: linetypes + type: linetype + repeat: expr + repeat-expr: header.table_linetype.items + - id: views + type: view + repeat: expr + repeat-expr: header.table_view.items + - id: block_entities + type: real_entities + size: header.blocks_size + - id: todo + size-eos: true + repeat: eos + if: not _io.eof +types: + block: + seq: + - id: flag + type: block_flag + doc: BLOCK/70 + - id: block_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: BLOCK/2 + - id: u2 + type: s1 + - id: u3 + type: s1 + - id: u4 + type: s1 + - id: u5 + type: s1 + block_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + header: + seq: + - id: magic + contents: [0x41, 0x43, 0x31, 0x2e, 0x35, 0x30] + doc: 0x0000-0x0005, $ACADVER + - id: zeros + size: 6 + - id: zero_one_or_three + type: s1 + - id: unknown_3 + type: s2 + - id: num_sections + type: s2 + - id: num_header_vars + type: s2 + - id: dwg_version + type: s1 + - id: entities_start + type: u4 + - id: entities_end + type: u4 + - id: blocks_start + type: u4 + - id: blocks_size_raw + type: u4 + - id: blocks_end + type: u4 + - id: unknown4b + size: 2 + - id: unknown4c + size: 2 + - id: table_block + type: table + - id: table_layer + type: table + - id: table_style + type: table + - id: table_linetype + type: table + - id: table_view + type: table + - id: variables + type: header_variables + instances: + blocks_size_unknown: + value: (blocks_size_raw & 0xff000000) >> 24 + blocks_size: + value: (blocks_size_raw & 0x00ffffff) + table: + seq: + - id: item_size + type: u2 + - id: items + type: u2 + - id: unknown + size: 2 + - id: begin + type: u4 + header_variables: + seq: + - id: insertion_base + type: point_3d + doc: 0x005e-0x0075, $INSBASE/10|20|30 + - id: num_entities + type: u2 + doc: 0x0076-0x0077 + - id: drawing_first + type: point_3d + doc: 0x0078-0x008f, $EXTMIN/10|20|30 + - id: drawing_second + type: point_3d + doc: 0x0090-0x00a7, $EXTMAX/10|20|30 + - id: limits_min + type: point_2d + doc: 0x00a8-0x00b7, $LIMMIN/10|20 + - id: limits_max + type: point_2d + doc: 0x00b8-0x00c7, $LIMMAX/10|20 + - id: view_ctrl + type: point_3d + doc: 0x00c8-0x00da, $VIEWCTRL/10|20|30 + - id: view_size + type: f8 + doc: 0x00e0-0x00e7 + - id: snap + type: s2 + doc: 0x00e8-0x00e9, $SNAPMODE + - id: snap_resolution + type: point_2d + doc: 0x00ea-0x00f9, $SNAPUNIT/10|20 + - id: snap_base + type: point_2d + doc: 0x00fa-0x0109, $SNAPBASE/10|20 + - id: snap_angle + type: f8 + doc: 0x010a-0x0111, $SNAPANG + - id: snap_style + type: s2 + doc: 0x0112-0x0113, $SNAPSTYLE + - id: snap_iso_pair + type: s2 + enum: iso_plane + doc: 0x0114-0x0115, $SNAPISOPAIR + - id: grid + type: s2 + doc: 0x0116-0x0117, $GRIDMODE + - id: grid_unit + type: point_2d + doc: 0x0118-0x0127, $GRIDUNIT/10|20 + - id: ortho + type: s2 + doc: 0x0128-0x0129, $ORTHOMODE + - id: regen + type: s2 + doc: 0x012a-0x012b, $REGENMODE + - id: fill + type: s2 + doc: 0x012c-0x012d, $FILLMODE + - id: qtext + type: s2 + doc: 0x012e-0x012f, $QTEXTMODE + - id: drag + type: s2 + doc: 0x0130-0x0131, $DRAGMODE + - id: linetype_scale + type: f8 + doc: 0x0132-0x0139, $LTSCALE + - id: text_size + type: f8 + doc: 0x013a-0x0141, $TEXTSIZE + - id: trace_width + type: f8 + doc: 0x0142-0x0149, $TRACEWID + - id: current_layer_index + type: s2 + doc: 0x014a-0x014b, $CLAYER + - id: current_color_convert + type: s2 + doc: 0x014c-0x014d, (2, 3, 8, 15 - default) + - id: unknown6 + type: f8 + doc: 0x014e-0x0155 + - id: unknown7a + type: s2 + doc: 0x0156-0x0157 + - id: unknown7b + type: s2 + doc: 0x0158-0x0159 + - id: unknown7c + type: s2 + doc: 0x015a-0x015b + - id: unknown8 + type: f8 + doc: 0x015c-0x0163 + - id: linear_units_format + enum: unit_types + type: s2 + doc: 0x0164-0x0165, $LUNITS + - id: linear_units_precision + type: s2 + doc: 0x0166-0x0167, $LUPREC + - id: axis + type: s2 + doc: 0x0168-0x0169, $AXISMODE + - id: axis_value + type: point_2d + doc: 0x016a-0x0179, $AXISUNIT/10|20 + - id: sketch_increment + type: f8 + doc: 0x017a-0x0181, $SKETCHINC + - id: fillet_radius + type: f8 + doc: $FILLETRAD + - id: units_for_angles + enum: units_for_angles + type: s2 + doc: $AUNITS + - id: angular_precision + type: s2 + doc: $AUPREC + - id: text_style_index + type: s2 + doc: 0x018e-0x018f, $TEXTSTYLE (index) + - id: osnap + enum: osnap_modes + type: s2 + doc: 0x0190-0x0191, $OSMODE + - id: attributes + enum: attributes + type: s2 + doc: 0x0192-0x0193, $ATTMODE + - id: menu + size: 15 + type: str + encoding: ASCII + terminator: 0x00 + doc: 0x0194-0x01a2, $MENU + - id: dim_scale + type: f8 + doc: 0x01a3-0x01aa, $DIMSCALE + - id: dim_arrowhead_size + type: f8 + doc: $DIMASZ + - id: dim_extension_line_offset + type: f8 + doc: $DIMEXO + - id: dim_baseline_spacing + type: f8 + doc: $DIMDLI + - id: dim_extension_line_extend + type: f8 + doc: $DIMEXE + - id: dim_maximum_tolerance_limit + type: f8 + doc: 0x01cb-0x01d2, $DIMTP + - id: dim_minimum_tolerance_limit + type: f8 + doc: 0x01d3-0x01da, $DIMTM + - id: dim_text_height + type: f8 + doc: 0x01db-0x01e2, $DIMTXT + - id: dim_center_mark_control + type: f8 + doc: 0x01e3-0x01ea, $DIMCEN + - id: dim_oblique_stroke_size + type: f8 + doc: 0x01eb-0x01f2, $DIMTSZ + - id: dim_tolerances + type: s1 + doc: 0x01f3, $DIMTOL + - id: dim_limits_default_text + type: s1 + doc: 0x01f4, $DIMLIM + - id: dim_text_ext_inside_line_position + type: s1 + doc: 0x01f5, $DIMTIH + - id: dim_text_ext_outside_line_position + type: s1 + doc: 0x01f6, $DIMTOH + - id: dim_extension_line_first_suppress + type: s1 + doc: 0x01f7, $DIMSE1 + - id: dim_extension_line_second_suppress + type: s1 + doc: 0x01f8, $DIMSE2 + - id: dim_text_vertical_position + type: s1 + doc: 0x01f9, $DIMTAD + - id: limits_check + enum: limits_check + type: s2 + doc: 0x01fa-0x01fb, $LIMCHECK + if: _parent.num_header_vars == 83 + - id: unknown10 + size: 45 + if: _parent.num_header_vars == 83 + - id: elevation + type: f8 + doc: 0x0229-0x0230, $ELEVATION + if: _parent.num_header_vars == 83 + - id: thickness + type: f8 + doc: 0x0231-0x0238, $THICKNESS + if: _parent.num_header_vars == 83 + - id: view_point + type: point_3d + doc: 0x0239-0x0251, $VIEWDIR/10|20|30 + if: _parent.num_header_vars == 83 + - id: unknown_repeating + type: unknown_repeating + doc: 0x0252-0x02e0 + if: _parent.num_header_vars == 83 + - id: unknown29 + type: s2 + doc: 0x02e1-0x02e2 + if: _parent.num_header_vars == 83 + - id: blip + type: s2 + doc: 0x02e3-0x02e4, $BLIPMODE + if: _parent.num_header_vars == 83 + unknown_repeating: + seq: + - id: unknown_repeating1 + type: f8 + - id: unknown_repeating2 + type: f8 + - id: unknown_repeating3 + type: f8 + - id: unknown_repeating4 + type: f8 + - id: unknown_repeating5 + type: f8 + - id: unknown_repeating6 + type: f8 + - id: unknown_repeating7 + type: f8 + - id: unknown_repeating8 + type: f8 + - id: unknown_repeating9 + type: f8 + - id: unknown_repeating10 + type: f8 + - id: unknown_repeating11 + type: f8 + - id: unknown_repeating12 + type: f8 + - id: unknown_repeating13 + type: f8 + - id: unknown_repeating14 + type: f8 + - id: unknown_repeating15 + type: f8 + - id: unknown_repeating16 + type: f8 + - id: unknown_repeating17 + type: f8 + - id: unknown_repeating18 + type: f8 + entity: + seq: + - id: entity_type + type: s1 + enum: entities + - id: data + type: + switch-on: entity_type + cases: + 'entities::arc': entity_arc + 'entities::attdef': entity_attdef + 'entities::attrib': entity_attrib + 'entities::block_begin': entity_block_begin + 'entities::block_end': entity_block_end + 'entities::insert' : entity_insert + 'entities::circle': entity_circle + 'entities::dim': entity_dim + 'entities::face3d': entity_face3d + 'entities::line': entity_line + 'entities::line3d': entity_line3d + 'entities::point': entity_point + 'entities::polyline': entity_polyline + 'entities::polyline2': entity_polyline + 'entities::repeat_begin': entity_repeat_begin + 'entities::repeat_end': entity_repeat_end + 'entities::seqend': entity_seqend + 'entities::shape': entity_shape + 'entities::solid': entity_solid + 'entities::text': entity_text + 'entities::trace': entity_trace + 'entities::vertex': entity_vertex + _: entity_tmp + entity_mode: + seq: + - id: entity_mode1 + type: b1 + - id: entity_mode2 + type: b1 + - id: entity_mode3 + type: b1 + - id: entity_mode4 + type: b1 + - id: entity_thickness_flag + type: b1 + - id: entity_elevation_flag + type: b1 + - id: entity_linetype_flag + type: b1 + - id: entity_color_flag + type: b1 + entity_common: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: entity_layer_index + type: s1 + - id: flag1 + type: s1 + - id: flag2_1 + type: b1 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_6 + type: b1 + - id: flag2_7 + type: b1 + - id: flag2_8 + type: b1 + - id: flag3_1 + type: b1 + - id: flag3_2 + type: b1 + - id: flag3_3 + type: b1 + - id: flag3_4 + type: b1 + - id: flag3_5 + type: b1 + - id: flag3_6 + type: b1 + - id: flag3_7 + type: b1 + - id: flag3_8 + type: b1 + - id: entity_color + type: s1 + if: entity_mode.entity_color_flag + - id: entity_linetype_index + type: s1 + if: entity_mode.entity_linetype_flag + - id: entity_elevation + type: f8 + if: entity_mode.entity_elevation_flag + - id: entity_thickness + type: f8 + if: entity_mode.entity_thickness_flag + entity_arc: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: ARC/10 + - id: y + type: f8 + doc: ARC/20 + - id: radius + type: f8 + doc: ARC/40 + - id: angle_from + type: f8 + doc: ARC/50 + - id: angle_to + type: f8 + doc: ARC/51 + entity_attdef: + seq: + - id: entity_common + type: entity_common + - id: start_point + type: point_2d + doc: ATTDEF/10|20 + - id: height + type: f8 + doc: ATTDEF/40 + - id: default_size + type: s2 + - id: default + size: default_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/1 + - id: prompt_size + type: s2 + - id: prompt + size: prompt_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/3 + - id: tag_size + type: s2 + - id: tag + size: tag_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/2 + - id: flags + type: attdef_flags + doc: ATTDEF/70 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_7 + doc: ATTDEF/50 + - id: width_scale_factor + type: f8 + if: entity_common.flag2_6 + doc: ATTDEF/41 + - id: unknown_index + type: u1 + if: entity_common.flag2_4 + - id: flags2 + type: attdef_flags2 + if: entity_common.flag2_2 + doc: ATTDEF/72 + - id: end_point + type: point_2d + if: entity_common.flag2_1 + doc: ATTDEF/11|21 + attdef_flags: + seq: + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: invisible + type: b1 + - id: constant + type: b1 + - id: verify + type: b1 + attdef_flags2: + seq: +## TODO Tohle je divne + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: middle + type: b1 + - id: right + type: b1 + - id: center + type: b1 + entity_attrib: + seq: + - id: entity_common + type: entity_common + - id: u1 + type: f8 + - id: u2 + type: f8 + - id: u3 + type: f8 + - id: size + type: s2 + - id: text + size: size + - id: size2 + type: s2 + - id: text2 + size: size2 + - id: u4 + size: 1 + - id: u5 + type: f8 + if: entity_common.flag2_7 + - id: u6 + type: u1 + if: entity_common.flag2_2 + # 1, 2 nebo 7? + - id: u7 + type: f8 + if: entity_common.flag2_1 + - id: u8 + type: f8 + if: entity_common.flag2_1 + entity_block_begin: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + entity_block_end: + seq: + - id: entity_common + type: entity_common + entity_insert: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + doc: INSERT/2 + - id: x + type: f8 + doc: INSERT/10 + - id: y + type: f8 + doc: INSERT/20 + - id: x_scale + type: f8 + if: entity_common.flag2_8 + doc: INSERT/41 + - id: y_scale + type: f8 + if: entity_common.flag2_7 + doc: INSERT/42 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_6 + doc: INSERT/50 + - id: z_scale + type: f8 + if: entity_common.flag2_5 + doc: INSERT/43 + - id: columns + type: u2 + if: entity_common.flag2_4 + doc: INSERT/70 + - id: rows + type: u2 + if: entity_common.flag2_3 + doc: INSERT/71 + - id: column_spacing + type: f8 + if: entity_common.flag2_2 + doc: INSERT/44 + - id: row_spacing + type: f8 + if: entity_common.flag2_1 + doc: INSERT/45 + entity_circle: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: CIRCLE/10 + - id: y + type: f8 + doc: CIRCLE/20 + - id: radius + type: f8 + doc: CIRCLE/40 + entity_dim: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + - id: dimension_line_defining_point + type: point_2d + doc: DIMENSION/10|20 + - id: default_text_position + type: point_2d + doc: DIMENSION/11|21 + - id: unknown1 + type: u1 + if: entity_common.flag2_7 + doc: DIMENSION/70 + - id: text_size + type: s2 + if: entity_common.flag2_6 + - id: text + size: text_size + if: entity_common.flag2_6 + doc: DIMENSION/1 + - id: extension_defining_point1 + type: point_2d + if: entity_common.flag2_5 + doc: DIMENSION/13|23 + - id: extension_defining_point2 + type: point_2d + if: entity_common.flag2_4 + doc: DIMENSION/14|24 + - id: defining_point + type: point_2d + if: entity_common.flag2_3 + doc: DIMENSION/15|25 + - id: dimension_line_arc_definition_point + type: point_2d + if: entity_common.flag2_2 + - id: rotation_in_radians + type: f8 + if: entity_common.flag3_8 + entity_face3d: + seq: + - id: entity_common + type: entity_common + entity_line: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: LINE/10 + - id: y1 + type: f8 + doc: LINE/20 + - id: x2 + type: f8 + doc: LINE/11 + - id: y2 + type: f8 + doc: LINE/21 + entity_line3d: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: 3DLINE/10 + - id: y1 + type: f8 + doc: 3DLINE/20 + - id: z1 + type: f8 + if: entity_common.flag2_8 + doc: 3DLINE/30 + - id: x2 + type: f8 + doc: 3DLINE/11 + - id: y2 + type: f8 + doc: 3DLINE/21 + - id: z2 + type: f8 + if: entity_common.flag2_7 + doc: 3DLINE/31 + entity_tmp: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: xxx + size: entity_size - 4 + entity_point: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: POINT/10 + - id: y + type: f8 + doc: POINT/20 + entity_polyline: + seq: + - id: entity_common + type: entity_common + - id: closed + type: u1 + if: entity_common.flag2_8 + doc: POLYLINE/66 + - id: x + type: f8 + if: entity_common.flag2_7 + doc: POLYLINE/40 + - id: y + type: f8 + if: entity_common.flag2_6 + doc: POLYLINE/41 + entity_repeat_begin: + seq: + - id: entity_common + type: entity_common + entity_repeat_end: + seq: + - id: entity_common + type: entity_common + - id: columns + type: s2 + doc: ENDREP/70 + - id: rows + type: s2 + doc: ENDREP/71 + - id: x + type: f8 + doc: ENDREP/40 + - id: y + type: f8 + doc: ENDREP/41 + entity_seqend: + seq: + - id: entity_common + type: entity_common + - id: unknown + size: 4 + entity_shape: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + - id: height + type: f8 + - id: item_num + type: u1 + - id: angle_in_radians + type: f8 + if: entity_common.flag2_8 + - id: load_num + type: u1 + entity_solid: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_text: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: TEXT/10 + - id: y + type: f8 + doc: TEXT/20 + - id: height + type: f8 + doc: TEXT/40 + - id: size + type: s2 + - id: value + size: size + type: str + encoding: ASCII + terminator: 0x00 + doc: TEXT/1 + - id: angle + type: f8 + if: entity_common.flag2_8 + - id: width_factor + type: f8 + if: entity_common.flag2_7 + doc: TEXT/41 + - id: obliquing_angle + type: f8 + if: entity_common.flag2_6 + doc: TEXT/51 + - id: style_index + type: u1 + if: entity_common.flag2_5 + doc: TEXT/7 + - id: generation + type: generation_flags + if: entity_common.flag2_4 + doc: TEXT/71 + - id: type + enum: text_type + type: u1 + if: entity_common.flag2_3 + doc: TEXT/72 + - id: aligned_to + type: point_2d + if: entity_common.flag2_2 + doc: TEXT/11|21 + entity_trace: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_vertex: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: VERTEX/10 + - id: y + type: f8 + doc: VERTEX/20 + - id: width + type: f8 + if: entity_common.flag2_8 + - id: bulge + type: f8 + if: entity_common.flag2_6 + doc: VERTEX/42 + - id: unknown_in_radians + type: f8 + if: entity_common.flag2_4 + doc: VERTEX/50 + layer: + seq: + - id: flag + type: layer_flag + doc: LAYER/70 + - id: layer_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LAYER/2 + - id: color + type: s2 + doc: LAYER/62 + - id: linetype_index + type: u2 + doc: LAYER/6 + - id: unknown4 + type: s1 + if: _root.header.num_header_vars == 74 + layer_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + linetype: + seq: + - id: flag + type: linetype_flag + doc: LTYPE/70 + - id: linetype_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/2 + - id: description + size: 48 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/3 + - id: alignment + type: u1 + doc: LTYPE/72 + - id: num_dashes + type: u1 + doc: LTYPE/73 + - id: pattern_len + type: f8 + doc: LTYPE/40 + - id: pattern + type: pattern + doc: LTYPE/49 + - id: unknown1 + type: s1 + if: _root.header.num_header_vars == 74 + pattern: + seq: + - id: pattern1 + type: f8 + - id: pattern2 + type: f8 + - id: pattern3 + type: f8 + - id: pattern4 + type: f8 + - id: pattern5 + type: f8 + - id: pattern6 + type: f8 + - id: pattern7 + type: f8 + - id: pattern8 + type: f8 + - id: pattern9 + type: f8 + - id: pattern10 + type: f8 + - id: pattern11 + type: f8 + - id: pattern12 + type: f8 + linetype_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + real_entities: + seq: + - id: entities + type: entity + repeat: eos + style: + seq: + - id: flag + type: style_flag + doc: STYLE/70 + - id: style_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/2 + - id: height + type: f8 + doc: STYLE/40 + - id: width_factor + type: f8 + doc: STYLE/41 + - id: obliquing_angle_in_radians + type: f8 + doc: STYLE/50 + - id: generation + type: generation_flags + doc: STYLE/71 + - id: last_height + type: f8 + doc: STYLE/42 + - id: font_file + size: 64 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/3 + style_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: vertical + type: b1 + - id: flag7 + type: b1 + - id: load + type: b1 + view: + seq: + - id: flag + type: view_flag + doc: VIEW/70 + - id: view_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + - id: view_size + type: f8 + doc: VIEW/40 + - id: center_point + type: point_2d + doc: VIEW/10|20 + - id: view_width + type: f8 + doc: VIEW/41 + - id: u2 + type: u1 + if: _root.header.num_header_vars == 74 + doc: TODO Right place in sequence? + - id: view_dir + type: point_3d + if: _root.header.num_header_vars == 83 + doc: VIEW/11|21|31 + - id: u3 + type: u2 + if: _root.header.num_header_vars == 83 + view_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + generation_flags: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: upside_down + type: b1 + - id: backwards + type: b1 + - id: flag8 + type: b1 + point_2d: + seq: + - id: x + type: f8 + - id: y + type: f8 + point_3d: + seq: + - id: x + type: f8 + - id: y + type: f8 + - id: z + type: f8 +enums: + entities: + 1: line + 2: point + 3: circle + 4: shape + 5: repeat_begin + 6: repeat_end + 7: text + 8: arc + 9: trace + # NOT_USED 10: load + 11: solid + 12: block_begin + 13: block_end + 14: insert + 15: attdef + 16: attrib + 17: seqend + 18: polyline + 19: polyline2 + 20: vertex + 21: line3d + 22: face3d + 23: dim + osnap_modes: + 0: none + 1: endpoint + 2: midpoint + 4: center + 8: node + 16: quadrant + 32: intersection + 64: insertion + 128: perpendicular + 256: tangent + 512: nearest + unit_types: + 1: scientific + 2: decimal + 3: engineering + 4: architectural + 5: fractional + units_for_angles: + 0: decimal_degrees + 1: degrees_minutes_seconds + 2: gradians + 3: radians + 4: surveyor_s_units + angle_direction: + 0: counterclockwise + 1: clockwise + limits_check: + 0: objects_can_outside_grid + 1: objects_cannot_outside_grid + coordinates: + 0: absolute_coordinates + 1: absolute_coordinates_realtime + 2: relative_polar_coordinates + attributes: + 0: off + 1: normal + 2: on + current_color: + 0: byblock + 1: red + 2: yellow + 3: green + 4: cyan + 5: blue + 6: magenta + 7: white + 256: bylayer + iso_plane: + 0: left + 1: top + 2: right + text_type: + 1: center + 2: end + 3: aligned diff --git a/dwg_ac2_10.ksy b/dwg_ac2_10.ksy new file mode 100644 index 0000000..94900d3 --- /dev/null +++ b/dwg_ac2_10.ksy @@ -0,0 +1,1208 @@ +meta: + id: dwg_ac2_10 + title: AutoCAD drawing (AC1003) + application: AutoCAD + file-extension: + - dwg + license: CC0-1.0 + xref: + justsolve: DWG + pronom: + fmt: 26 + mime: + - application/x-dwg + - image/vnd.dwg + wikidata: Q27863116 + endian: le +seq: + - id: header + type: header + - id: entities + type: real_entities + size: header.entities_end - header.entities_start + - id: blocks + type: block + repeat: expr + repeat-expr: header.table_block.items + - id: layers + type: layer + repeat: expr + repeat-expr: header.table_layer.items + - id: styles + type: style + repeat: expr + repeat-expr: header.table_style.items + - id: linetypes + type: linetype + repeat: expr + repeat-expr: header.table_linetype.items + - id: views + type: view + repeat: expr + repeat-expr: header.table_view.items + - id: block_entities + type: real_entities + size: header.blocks_size + - id: todo + size-eos: true + repeat: eos + if: not _io.eof +types: + block: + seq: + - id: flag + type: block_flag + doc: BLOCK/70 + - id: block_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: BLOCK/2 + - id: u2 + type: s1 + - id: u3 + type: s1 + - id: u4 + type: s1 + - id: u5 + type: s1 + block_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + header: + seq: + - id: magic + contents: [0x41, 0x43, 0x32, 0x2e, 0x31, 0x30] + doc: 0x0000-0x0005, $ACADVER + - id: zeros + size: 6 + - id: zero_one_or_three + type: s1 + - id: unknown_3 + type: s2 + - id: num_sections + type: s2 + - id: num_header_vars + type: s2 + - id: dwg_version + type: s1 + - id: entities_start + type: u4 + - id: entities_end + type: u4 + - id: blocks_start + type: u4 + - id: blocks_size_raw + type: u4 + - id: blocks_end + type: u4 + - id: unknown4b + size: 2 + - id: unknown4c + size: 2 + - id: table_block + type: table + - id: table_layer + type: table + - id: table_style + type: table + - id: table_linetype + type: table + - id: table_view + type: table + - id: variables + type: header_variables + instances: + blocks_size_unknown: + value: (blocks_size_raw & 0xff000000) >> 24 + blocks_size: + value: (blocks_size_raw & 0x00ffffff) + table: + seq: + - id: item_size + type: u2 + - id: items + type: u2 + - id: unknown + size: 2 + - id: begin + type: u4 + header_variables: + seq: + - id: insertion_base + type: point_3d + doc: 0x005e-0x0075, $INSBASE/10|20|30 + - id: num_entities + type: u2 + doc: 0x0076-0x0077 + - id: drawing_first + type: point_3d + doc: 0x0078-0x008f, $EXTMIN/10|20|30 + - id: drawing_second + type: point_3d + doc: 0x0090-0x00a7, $EXTMAX/10|20|30 + - id: limits_min + type: point_2d + doc: 0x00a8-0x00b7, $LIMMIN/10|20 + - id: limits_max + type: point_2d + doc: 0x00b8-0x00c7, $LIMMAX/10|20 + - id: view_ctrl + type: point_3d + doc: 0x00c8-0x00da, $VIEWCTRL/10|20|30 + - id: view_size + type: f8 + doc: 0x00e0-0x00e7 + - id: snap + type: s2 + doc: 0x00e8-0x00e9, $SNAPMODE + - id: snap_resolution + type: point_2d + doc: 0x00ea-0x00f9, $SNAPUNIT/10|20 + - id: snap_base + type: point_2d + doc: 0x00fa-0x0109, $SNAPBASE/10|20 + - id: snap_angle + type: f8 + doc: 0x010a-0x0111, $SNAPANG + - id: snap_style + type: s2 + doc: 0x0112-0x0113, $SNAPSTYLE + - id: snap_iso_pair + type: s2 + enum: iso_plane + doc: 0x0114-0x0115, $SNAPISOPAIR + - id: grid + type: s2 + doc: 0x0116-0x0117, $GRIDMODE + - id: grid_unit + type: point_2d + doc: 0x0118-0x0127, $GRIDUNIT/10|20 + - id: ortho + type: s2 + doc: 0x0128-0x0129, $ORTHOMODE + - id: regen + type: s2 + doc: 0x012a-0x012b, $REGENMODE + - id: fill + type: s2 + doc: 0x012c-0x012d, $FILLMODE + - id: qtext + type: s2 + doc: 0x012e-0x012f, $QTEXTMODE + - id: drag + type: s2 + doc: 0x0130-0x0131, $DRAGMODE + - id: linetype_scale + type: f8 + doc: 0x0132-0x0139, $LTSCALE + - id: text_size + type: f8 + doc: 0x013a-0x0141, $TEXTSIZE + - id: trace_width + type: f8 + doc: 0x0142-0x0149, $TRACEWID + - id: current_layer_index + type: s2 + doc: 0x014a-0x014b, $CLAYER + - id: current_color_convert + type: s2 + doc: 0x014c-0x014d, (2, 3, 8, 15 - default) + - id: unknown6 + type: f8 + doc: 0x014e-0x0155 + - id: unknown7a + type: s2 + doc: 0x0156-0x0157 + - id: unknown7b + type: s2 + doc: 0x0158-0x0159 + - id: unknown7c + type: s2 + doc: 0x015a-0x015b + - id: unknown8 + type: f8 + doc: 0x015c-0x0163 + - id: linear_units_format + enum: unit_types + type: s2 + doc: 0x0164-0x0165, $LUNITS + - id: linear_units_precision + type: s2 + doc: 0x0166-0x0167, $LUPREC + - id: axis + type: s2 + doc: 0x0168-0x0169, $AXISMODE + - id: axis_value + type: point_2d + doc: 0x016a-0x0179, $AXISUNIT/10|20 + - id: sketch_increment + type: f8 + doc: 0x017a-0x0181, $SKETCHINC + - id: fillet_radius + type: f8 + doc: $FILLETRAD + - id: units_for_angles + enum: units_for_angles + type: s2 + doc: $AUNITS + - id: angular_precision + type: s2 + doc: $AUPREC + - id: text_style_index + type: s2 + doc: 0x018e-0x018f, $TEXTSTYLE (index) + - id: osnap + enum: osnap_modes + type: s2 + doc: 0x0190-0x0191, $OSMODE + - id: attributes + enum: attributes + type: s2 + doc: 0x0192-0x0193, $ATTMODE + - id: menu + size: 15 + type: str + encoding: ASCII + terminator: 0x00 + doc: 0x0194-0x01a2, $MENU + - id: dim_scale + type: f8 + doc: 0x01a3-0x01aa, $DIMSCALE + - id: dim_arrowhead_size + type: f8 + doc: $DIMASZ + - id: dim_extension_line_offset + type: f8 + doc: $DIMEXO + - id: dim_baseline_spacing + type: f8 + doc: $DIMDLI + - id: dim_extension_line_extend + type: f8 + doc: $DIMEXE + - id: dim_maximum_tolerance_limit + type: f8 + doc: 0x01cb-0x01d2, $DIMTP + - id: dim_minimum_tolerance_limit + type: f8 + doc: 0x01d3-0x01da, $DIMTM + - id: dim_text_height + type: f8 + doc: 0x01db-0x01e2, $DIMTXT + - id: dim_center_mark_control + type: f8 + doc: 0x01e3-0x01ea, $DIMCEN + - id: dim_oblique_stroke_size + type: f8 + doc: 0x01eb-0x01f2, $DIMTSZ + - id: dim_tolerances + type: s1 + doc: 0x01f3, $DIMTOL + - id: dim_limits_default_text + type: s1 + doc: 0x01f4, $DIMLIM + - id: dim_text_ext_inside_line_position + type: s1 + doc: 0x01f5, $DIMTIH + - id: dim_text_ext_outside_line_position + type: s1 + doc: 0x01f6, $DIMTOH + - id: dim_extension_line_first_suppress + type: s1 + doc: 0x01f7, $DIMSE1 + - id: dim_extension_line_second_suppress + type: s1 + doc: 0x01f8, $DIMSE2 + - id: dim_text_vertical_position + type: s1 + doc: 0x01f9, $DIMTAD + - id: limits_check + enum: limits_check + type: s2 + doc: 0x01fa-0x01fb, $LIMCHECK + - id: unknown10 + size: 45 + - id: elevation + type: f8 + doc: 0x0229-0x0230, $ELEVATION + - id: thickness + type: f8 + doc: 0x0231-0x0238, $THICKNESS + - id: view_point + type: point_3d + doc: 0x0239-0x0251, $VIEWDIR/10|20|30 + - id: unknown_repeating + type: unknown_repeating + doc: 0x0252-0x02e0 + - id: unknown29 + type: s2 + doc: 0x02e1-0x02e2 + - id: blip + type: s2 + doc: 0x02e3-0x02e4, $BLIPMODE + unknown_repeating: + seq: + - id: unknown_repeating1 + type: f8 + - id: unknown_repeating2 + type: f8 + - id: unknown_repeating3 + type: f8 + - id: unknown_repeating4 + type: f8 + - id: unknown_repeating5 + type: f8 + - id: unknown_repeating6 + type: f8 + - id: unknown_repeating7 + type: f8 + - id: unknown_repeating8 + type: f8 + - id: unknown_repeating9 + type: f8 + - id: unknown_repeating10 + type: f8 + - id: unknown_repeating11 + type: f8 + - id: unknown_repeating12 + type: f8 + - id: unknown_repeating13 + type: f8 + - id: unknown_repeating14 + type: f8 + - id: unknown_repeating15 + type: f8 + - id: unknown_repeating16 + type: f8 + - id: unknown_repeating17 + type: f8 + - id: unknown_repeating18 + type: f8 + entity: + seq: + - id: entity_type + type: s1 + enum: entities + - id: data + type: + switch-on: entity_type + cases: + 'entities::arc': entity_arc + 'entities::attdef': entity_attdef + 'entities::attrib': entity_attrib + 'entities::block_begin': entity_block_begin + 'entities::block_end': entity_block_end + 'entities::insert' : entity_insert + 'entities::circle': entity_circle + 'entities::line': entity_line + 'entities::point': entity_point + 'entities::polyline': entity_polyline + 'entities::polyline2': entity_polyline + 'entities::repeat_begin': entity_repeat_begin + 'entities::repeat_end': entity_repeat_end + 'entities::seqend': entity_seqend + 'entities::shape': entity_shape + 'entities::solid': entity_solid + 'entities::text': entity_text + 'entities::trace': entity_trace + 'entities::vertex': entity_vertex + _: entity_tmp + entity_mode: + seq: + - id: entity_mode1 + type: b1 + - id: entity_mode2 + type: b1 + - id: entity_mode3 + type: b1 + - id: entity_mode4 + type: b1 + - id: entity_thickness_flag + type: b1 + - id: entity_elevation_flag + type: b1 + - id: entity_linetype_flag + type: b1 + - id: entity_color_flag + type: b1 + entity_common: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: entity_layer_index + type: s1 + - id: flag1 + type: s1 + - id: flag2_1 + type: b1 + - id: flag2_2 + type: b1 + - id: flag2_3 + type: b1 + - id: flag2_4 + type: b1 + - id: flag2_5 + type: b1 + - id: flag2_6 + type: b1 + - id: flag2_7 + type: b1 + - id: flag2_8 + type: b1 + - id: flag3_1 + type: b1 + - id: flag3_2 + type: b1 + - id: flag3_3 + type: b1 + - id: flag3_4 + type: b1 + - id: flag3_5 + type: b1 + - id: flag3_6 + type: b1 + - id: flag3_7 + type: b1 + - id: flag3_8 + type: b1 + - id: entity_color + type: s1 + if: entity_mode.entity_color_flag + - id: entity_linetype_index + type: s1 + if: entity_mode.entity_linetype_flag + - id: entity_elevation + type: f8 + if: entity_mode.entity_elevation_flag + - id: entity_thickness + type: f8 + if: entity_mode.entity_thickness_flag + entity_arc: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: ARC/10 + - id: y + type: f8 + doc: ARC/20 + - id: radius + type: f8 + doc: ARC/40 + - id: angle_from + type: f8 + doc: ARC/50 + - id: angle_to + type: f8 + doc: ARC/51 + entity_attdef: + seq: + - id: entity_common + type: entity_common + - id: start_point + type: point_2d + doc: ATTDEF/10|20 + - id: height + type: f8 + doc: ATTDEF/40 + - id: default_size + type: s2 + - id: default + size: default_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/1 + - id: prompt_size + type: s2 + - id: prompt + size: prompt_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/3 + - id: tag_size + type: s2 + - id: tag + size: tag_size + type: str + encoding: ASCII + terminator: 0x00 + doc: ATTDEF/2 + - id: flags + type: attdef_flags + doc: ATTDEF/70 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_7 + doc: ATTDEF/50 + - id: width_scale_factor + type: f8 + if: entity_common.flag2_6 + doc: ATTDEF/41 + - id: unknown_index + type: u1 + if: entity_common.flag2_4 + - id: flags2 + type: attdef_flags2 + if: entity_common.flag2_2 + doc: ATTDEF/72 + - id: end_point + type: point_2d + if: entity_common.flag2_1 + doc: ATTDEF/11|21 + attdef_flags: + seq: + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: invisible + type: b1 + - id: constant + type: b1 + - id: verify + type: b1 + attdef_flags2: + seq: +## TODO Tohle je divne + - id: flag_1 + type: b1 + - id: flag_2 + type: b1 + - id: flag_3 + type: b1 + - id: flag_4 + type: b1 + - id: flag_5 + type: b1 + - id: middle + type: b1 + - id: right + type: b1 + - id: center + type: b1 + entity_attrib: + seq: + - id: entity_common + type: entity_common + - id: u1 + type: f8 + - id: u2 + type: f8 + - id: u3 + type: f8 + - id: size + type: s2 + - id: text + size: size + - id: size2 + type: s2 + - id: text2 + size: size2 + - id: u4 + size: 1 + - id: u5 + type: f8 + if: entity_common.flag2_7 + - id: u6 + type: u1 + if: entity_common.flag2_2 + # 1, 2 nebo 7? + - id: aligned_to + type: point_2d + if: entity_common.flag2_1 + doc: ATTRIB/11|21 + entity_block_begin: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + - id: y + type: f8 + entity_block_end: + seq: + - id: entity_common + type: entity_common + entity_insert: + seq: + - id: entity_common + type: entity_common + - id: block_index + type: s2 + doc: INSERT/2 + - id: x + type: f8 + doc: INSERT/10 + - id: y + type: f8 + doc: INSERT/20 + - id: x_scale + type: f8 + if: entity_common.flag2_8 + doc: INSERT/41 + - id: y_scale + type: f8 + if: entity_common.flag2_7 + doc: INSERT/42 + - id: rotation_angle_in_radians + type: f8 + if: entity_common.flag2_6 + doc: INSERT/50 + - id: z_scale + type: f8 + if: entity_common.flag2_5 + doc: INSERT/43 + - id: columns + type: u2 + if: entity_common.flag2_4 + doc: INSERT/70 + - id: rows + type: u2 + if: entity_common.flag2_3 + doc: INSERT/71 + - id: column_spacing + type: f8 + if: entity_common.flag2_2 + doc: INSERT/44 + - id: row_spacing + type: f8 + if: entity_common.flag2_1 + doc: INSERT/45 + entity_circle: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: CIRCLE/10 + - id: y + type: f8 + doc: CIRCLE/20 + - id: radius + type: f8 + doc: CIRCLE/40 + entity_line: + seq: + - id: entity_common + type: entity_common + - id: x1 + type: f8 + doc: LINE/10 + - id: y1 + type: f8 + doc: LINE/20 + - id: x2 + type: f8 + doc: LINE/11 + - id: y2 + type: f8 + doc: LINE/21 + entity_tmp: + seq: + - id: entity_mode + type: entity_mode + - id: entity_size + type: s2 + - id: xxx + size: entity_size - 4 + entity_point: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: POINT/10 + - id: y + type: f8 + doc: POINT/20 + entity_polyline: + seq: + - id: entity_common + type: entity_common + - id: closed + type: u1 + if: entity_common.flag2_8 + doc: POLYLINE/66 + - id: x + type: f8 + if: entity_common.flag2_7 + doc: POLYLINE/40 + - id: y + type: f8 + if: entity_common.flag2_6 + doc: POLYLINE/41 + entity_repeat_begin: + seq: + - id: entity_common + type: entity_common + entity_repeat_end: + seq: + - id: entity_common + type: entity_common + - id: columns + type: s2 + doc: ENDREP/70 + - id: rows + type: s2 + doc: ENDREP/71 + - id: x + type: f8 + doc: ENDREP/40 + - id: y + type: f8 + doc: ENDREP/41 + entity_seqend: + seq: + - id: entity_common + type: entity_common + - id: unknown + size: 4 + entity_shape: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: SHAPE/10 + - id: y + type: f8 + doc: SHAPE/10 + - id: height + type: f8 + doc: SHAPE/40 + - id: item_num + type: u1 + doc: SHAPE/2 + - id: angle_in_radians + type: f8 + if: entity_common.flag2_8 + doc: SHAPE/50 + - id: load_num + type: u1 + entity_solid: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_text: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: TEXT/10 + - id: y + type: f8 + doc: TEXT/20 + - id: height + type: f8 + doc: TEXT/40 + - id: size + type: s2 + - id: value + size: size + type: str + encoding: ASCII + terminator: 0x00 + doc: TEXT/1 + - id: angle + type: f8 + if: entity_common.flag2_8 + - id: width_factor + type: f8 + if: entity_common.flag2_7 + doc: TEXT/41 + - id: obliquing_angle + type: f8 + if: entity_common.flag2_6 + doc: TEXT/51 + - id: style_index + type: u1 + if: entity_common.flag2_5 + doc: TEXT/7 + - id: generation + type: generation_flags + if: entity_common.flag2_4 + doc: TEXT/71 + - id: type + enum: text_type + type: u1 + if: entity_common.flag2_3 + doc: TEXT/72 + - id: aligned_to + type: point_2d + if: entity_common.flag2_2 + doc: TEXT/11|21 + entity_trace: + seq: + - id: entity_common + type: entity_common + - id: from + type: point_2d + - id: from_and + type: point_2d + - id: to + type: point_2d + - id: to_and + type: point_2d + entity_vertex: + seq: + - id: entity_common + type: entity_common + - id: x + type: f8 + doc: VERTEX/10 + - id: y + type: f8 + doc: VERTEX/20 + - id: width + type: f8 + if: entity_common.flag2_8 + - id: bulge + type: f8 + if: entity_common.flag2_6 + doc: VERTEX/42 + - id: unknown_in_radians + type: f8 + if: entity_common.flag2_4 + doc: VERTEX/50 + layer: + seq: + - id: flag + type: layer_flag + doc: LAYER/70 + - id: layer_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LAYER/2 + - id: color + type: s2 + doc: LAYER/62 + - id: linetype_index + type: u2 + doc: LAYER/6 + layer_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + linetype: + seq: + - id: flag + type: linetype_flag + doc: LTYPE/70 + - id: linetype_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/2 + - id: description + size: 48 + type: str + encoding: ASCII + terminator: 0x00 + doc: LTYPE/3 + - id: alignment + type: u1 + doc: LTYPE/72 + - id: num_dashes + type: u1 + doc: LTYPE/73 + - id: pattern_len + type: f8 + doc: LTYPE/40 + - id: pattern + type: pattern + doc: LTYPE/49 + pattern: + seq: + - id: pattern1 + type: f8 + - id: pattern2 + type: f8 + - id: pattern3 + type: f8 + - id: pattern4 + type: f8 + - id: pattern5 + type: f8 + - id: pattern6 + type: f8 + - id: pattern7 + type: f8 + - id: pattern8 + type: f8 + - id: pattern9 + type: f8 + - id: pattern10 + type: f8 + - id: pattern11 + type: f8 + - id: pattern12 + type: f8 + linetype_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: frozen + type: b1 + real_entities: + seq: + - id: entities + type: entity + repeat: eos + style: + seq: + - id: flag + type: style_flag + doc: STYLE/70 + - id: style_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/2 + - id: height + type: f8 + doc: STYLE/40 + - id: width_factor + type: f8 + doc: STYLE/41 + - id: obliquing_angle_in_radians + type: f8 + doc: STYLE/50 + - id: generation + type: generation_flags + doc: STYLE/71 + - id: last_height + type: f8 + doc: STYLE/42 + - id: font_file + size: 64 + type: str + encoding: ASCII + terminator: 0x00 + doc: STYLE/3 + style_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: vertical + type: b1 + - id: flag7 + type: b1 + - id: load + type: b1 + view: + seq: + - id: flag + type: view_flag + doc: VIEW/70 + - id: view_name + size: 32 + type: str + encoding: ASCII + terminator: 0x00 + - id: view_size + type: f8 + doc: VIEW/40 + - id: center_point + type: point_2d + doc: VIEW/10|20 + - id: view_width + type: f8 + doc: VIEW/41 + - id: view_dir + type: point_3d + doc: VIEW/11|21|31 + - id: flag_3d + type: u2 + view_flag: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: flag6 + type: b1 + - id: flag7 + type: b1 + - id: flag8 + type: b1 + generation_flags: + seq: + - id: flag1 + type: b1 + - id: flag2 + type: b1 + - id: flag3 + type: b1 + - id: flag4 + type: b1 + - id: flag5 + type: b1 + - id: upside_down + type: b1 + - id: backwards + type: b1 + - id: flag8 + type: b1 + point_2d: + seq: + - id: x + type: f8 + - id: y + type: f8 + point_3d: + seq: + - id: x + type: f8 + - id: y + type: f8 + - id: z + type: f8 +enums: + entities: + 1: line + 2: point + 3: circle + 4: shape + 5: repeat_begin + 6: repeat_end + 7: text + 8: arc + 9: trace + # NOT_USED 10: load + 11: solid + 12: block_begin + 13: block_end + 14: insert + 15: attdef + 16: attrib + 17: seqend + 18: polyline + 19: polyline2 + 20: vertex + osnap_modes: + 0: none + 1: endpoint + 2: midpoint + 4: center + 8: node + 16: quadrant + 32: intersection + 64: insertion + 128: perpendicular + 256: tangent + 512: nearest + unit_types: + 1: scientific + 2: decimal + 3: engineering + 4: architectural + 5: fractional + units_for_angles: + 0: decimal_degrees + 1: degrees_minutes_seconds + 2: gradians + 3: radians + 4: surveyor_s_units + angle_direction: + 0: counterclockwise + 1: clockwise + limits_check: + 0: objects_can_outside_grid + 1: objects_cannot_outside_grid + coordinates: + 0: absolute_coordinates + 1: absolute_coordinates_realtime + 2: relative_polar_coordinates + attributes: + 0: off + 1: normal + 2: on + iso_plane: + 0: left + 1: top + 2: right + text_type: + 1: center + 2: end + 3: aligned