Skip to content

DXF2BIM format contract

Generated by modeller/tools/gen_format_doc.js from the code's own tables: do not edit by hand. A person or another tool can read and write these files without reading our code.

1. Versions and the compatibility rule

Format Version Where it is stated
run outputs (verdict.json, ops.json, bill.json, format.json) dxf2bim-run/1 the format field of each object file; bodies.json is a bare array (existing consumers read it as one) and is described by format.json
settings sheet (the DXF2BIM-MARK layer) dxf2bim-marks/1 implicit: no version mark is written yet; a sheet without one is version 1 (the stamp needs an audit of BIMCompiler's golden outputs first)
IFC output IFC4 FILE_SCHEMA; evidence in the property set Dxf2Bim_Evidence (older files: Pset_Dxf2Bim, still read)
database the extractor's tables element_dxf2bim(guid, name, value) holds the evidence rows; absent when the IFC carries no evidence set

Rule. A reader accepts every older version. A writer states the version it writes. Removing or renaming a key, a file or a code needs a version bump and a migration note here. Adding an optional key does not.

2. The settings sheet: marks

Plain text on layer DXF2BIM-MARK of an ordinary DXF, one @KEY=value per TEXT/MTEXT; a trailing @BY=model|user says who stated it. Unknown keys are reported (MARK:unknown_key), never ignored.

Key Count Grammar Meaning
@SET one per sheet name the set (building) name: every sheet of one set carries the same
@VIEW one per sheet PLAN\|ELEV\|ROOF\|SECTION what the sheet is
@NAME one per sheet text the sheet name
@UNITS one per sheet mm\|cm\|m\|in\|ft the drawing units: confirmed by a person, the file header is only suggested
@LEVEL one per sheet number (m) the storey level of a plan or roof sheet
@FACE one per sheet minX\|maxX\|minY\|maxY which face of the building an elevation looks at
@HAXIS one per sheet +X\|-X\|+Y\|-Y the elevation's horizontal axis in plan
@REGION one per sheet x0,y0,x1,y1 the part of a sheet that is one storey / wing
@ROOF one per sheet number (m) the roof top height of a roof sheet (no drawing states it)
@CUT one per sheet X\|Y,<plan coordinate> where a section sheet cuts the plan
@SCOPE one per sheet KEY \| name,x0,y0,x1,y1 a storey's annotation sheet, or a wing / zone of a sheet
@FRAME one per sheet deg,x,y a wing drawn rotated by -deg about (x,y): the importer turns it back
@GRIDX several letter at a position a plan grid line in X (the mark's own position is the line)
@GRIDY several letter at a position a plan grid line in Y
@GRIDH several letter at a position an elevation grid line (horizontal position)
@Z several number (m) at a position a height datum: the z of the line the mark sits on
@EXCLUDE several x0,y0,x1,y1 an area the reader skips (counted, never silent)
@OPENING several door\|window,h0,y0,h1,y1 a stated opening rectangle on an elevation
@LABEL several class,x,y[,z=m],text a drawing label bound to a class (type name / size)
@SCHEDULE several text,door\|window,w,h \| text,wall,t one stated schedule row
@TAG several class[,z=m],... a tag naming a drawn element's type
@ALLOWANCE several door\|window,w,h a stated opening size where the drawing shows none
@WALLTOP several number (m) \| handle:<h>,<m> a stated wall-top convention (never a default)
@LAYER several layer,type what a layer means (the person's typing: a layer NAME is not evidence); types per view below
@BODYZ several kind,z0,z1 the height range of a body kind that no elevation draws
@SIZE several body id,x\|y\|w\|d,metres a stated size of one side of one body
@DEFAULT several key,value a stated value for a registry setting (beats the editor's choice and the registry)

Layer types per view (@LAYER=<layer>,<type>): PLAN: wall, wallline, slab, component, opening, glazing, ignore; ELEV: elevwall, elevdoor, glazing, levelline, ignore; ROOF: roof, glazing, ignore; SECTION: sectslab, sectwall, roof, ignore; ANY: dims, grid; BODY: column, beam, footing, gradebeam, member, plate, panel, bar, fan, net, doorswing.

Units: mm = 0.001 m, cm = 0.01 m, m = 1 m, in = 0.0254 m, ft = 0.3048 m.

3. Body kinds and their IFC class

Kind IFC class PredefinedType
bar IfcMember BRACE
beam IfcBeam BEAM
chord IfcMember CHORD
column IfcColumn COLUMN
door IfcDoor DOOR
doorswing IfcDoor DOOR
fan IfcFan PROPELLORAXIAL
footing IfcFooting PAD_FOOTING
gradebeam IfcBeam BEAM
gusset IfcPlate GUSSET_PLATE
member IfcMember MEMBER
net IfcCovering CLADDING
panel IfcWall STANDARD
plate IfcPlate PLATE
post IfcMember POST
purlin IfcMember PURLIN
roof IfcRoof GABLE_ROOF
slab IfcSlab BASESLAB
supportwall IfcWall STANDARD
wall IfcWall STANDARD
web IfcMember BRACE
window IfcWindow WINDOW

4. Run outputs

JSON Schemas (draft-07) in modeller/schemas/: dxf2bim-verdict.schema.json, dxf2bim-bodies.schema.json, dxf2bim-ops.schema.json, dxf2bim-bill.schema.json; W-FORMAT validates real outputs against them.

Evidence tiers on every body (prov): drawn (measured from a drawn entity), derived (computed from drawn evidence plus a stated convention), assumed (no drawn evidence for its existence or position). Evidence properties on every body (set Dxf2Bim_Evidence): Provenance, SourceSheet, SourceHandle, SourceLayer, Kind, SizeBasis; from a details sheet also Note_<key> + NoteSource_<key> and Sched_<Kind>_<header> + SchedSource_<kind> + SchedBasis_<kind>.

Layer ledger (verdict.layer_ledger, dxf2ledger.js): for every layer of every sheet, the entities on it, how it was typed, how many source entities produced a body, and a status: settings, annotation, ignored_by_choice, used, partly_used, evidence, typed_no_output, unread. unread = geometry on a layer nobody typed; typed_no_output = typed with a body kind but nothing was built; partly_used = some of its entities produced a body (the ratio is in used_entities / geometry); evidence = an elevation or section layer that gave heights or profiles. The entity account (ยงACCOUNT) only says the DXF parser read every entity; the ledger says what was USED.

5. Settings registry (modeller/element_defaults.json): 43 rows

Key Element Unit Kind Default Basis
beam.depth IfcBeam m guess 0.45 section depth when no label or band gives it
beam.width IfcBeam m guess 0.3 section width when no label or band gives it
building.type Building text guess General the kind of building; it selects the type-specific defaults and organises the reference component library. A person states it (@DEFAULT=buil
ceiling.thickness IfcCovering m guess 0.012 board thickness when a ceiling is implied
column.height IfcColumn m guess 3 storey height when no elevation gives it
column.size IfcColumn m guess 0.3 square section when a column symbol gives none
curtainwall.mullion IfcCurtainWall m guess 0.05 typical mullion width
door.height IfcDoor m guess 2.1 typical door set height; plans do not draw it
door.thickness IfcDoor m guess 0.04 typical leaf thickness for a leaf drawn as one line
door.width IfcDoor m guess 0.9 typical single leaf; used only for a door tag with no drawn swing or gap
fan.depth IfcFan m guess 0.3 housing depth; the diameter is drawn
floorfinish.thickness IfcCovering m guess 0.02 floor finish thickness when implied
footing.depth IfcFooting m guess 0.4 pad footing thickness
footing.length IfcFooting m guess 1.2 pad footing plan length when no schedule gives it
footing.width IfcFooting m guess 1.2 pad footing plan width
gradebeam.depth IfcBeam m guess 0.3 grade beam depth
gradebeam.width IfcBeam m guess 0.3 grade beam width when no label gives it
member.size IfcMember m guess 0.04 square envelope for a member with no label or size
net.thickness IfcCovering m guess 0.005 netting sheet thickness; the area is drawn
panel.plane IfcWall text guess end grid line, centred an elevation panel is placed on the outermost grid line of its face, centred
pile.diameter IfcPile m guess 0.3 typical bored pile diameter
pile.length IfcPile m guess 12 no pile length is drawn on a layout
plate.thickness IfcPlate m std 0.00635 1/4 in, the thickness the truss section's own label states (a plate with no label takes it)
railing.height IfcRailing m guess 1 typical guard height
railing.post_spacing IfcRailing m guess 1.2 typical post spacing
ramp.slope IfcRamp ratio guess 0.0833 1:12, a typical accessible ramp
roof.slope_deg IfcRoof deg guess 15 typical light roof pitch; used only when no gable or section gives the slope
section.spacing IfcMember text guess column pitch a section drawn once repeats at the column pitch from its cut
stair.going IfcStair m guess 0.25 typical tread depth
stair.riser IfcStair m guess 0.175 typical riser height; a stair symbol carries no riser
stair.width IfcStair m guess 1 typical flight width
synth.column.belowgrade.size IfcColumn m guess 0 0 = not stated: no below-grade column is built; state the schedule's below-grade section (e.g. 0.3556 for 14 in)
synth.column.grade_to_base IfcColumn m guess 0.6096 grade to the column base (plinth): 2 ft, the datum read from a column detail
synth.roof.overhang IfcRoof m guess 0 the roof is cut at the gable planes until an overhang is stated
synth.roof.sheet_thickness IfcRoof m guess 0.0254 display thickness of a roofing sheet (1 in); the cost is by area
synth.slab.footprint IfcSlab text guess outermost grid lines the slab edge is taken at the outermost grid lines of the base plan
synth.slab.thickness IfcSlab m std 0.25 rate pack: 'RC Slab 250mm' (viewer/rates/cidb2024_my.json IfcSlab)
wall.base IfcWall m guess 0 floor level of the storey
wall.height IfcWall m guess 3 typical storey wall height; not stated by a plan
wall.thickness IfcWall m std 0.15 rate pack: 'Blockwork Wall 150mm' (viewer/rates/cidb2024_my.json IfcWall)
window.height IfcWindow m guess 1.2 typical window height
window.sill IfcWindow m guess 0.9 typical sill height above the floor
window.width IfcWindow m guess 1.2 typical window width; used when a plan symbol gives no width

6. Code families (209 codes found in the source)

GAP:* = a part the product left out or could not build (advisory, never defaulted); QF:* = a qualification failure (blocks the set); MARK:* = a settings-sheet problem. Each code with the modules that raise it:

Code Raised in
GAP:bad_outline dxf2bim/dxf2mesh.js
GAP:bar_label_ambiguous dxf2section.js
GAP:bar_no_size dxf2section.js
GAP:body_ambiguous_z dxf2bodies.js
GAP:body_degenerate dxf2bodies.js
GAP:body_elevation_not_aligned dxf2bodies.js, dxf2structure.js
GAP:body_no_elevation dxf2bodies.js, dxf_meta_editor.js
GAP:body_no_plan dxf2bodies.js
GAP:body_plan_not_aligned dxf2bodies.js
GAP:body_stated_z_conflict dxf2bodies.js
GAP:column_not_symmetric dxf2bim/std2d.js
GAP:curtainwall_not_a_run dxf2bim/std2d.js
GAP:door_below_min_width dxf2bim/dxf2bim.js
GAP:door_closed_unknown dxf2doors.js
GAP:door_elevation_not_aligned dxf2doors.js
GAP:door_handing_conflict dxf2bim/std2d.js
GAP:door_height_conflict dxf2doors.js
GAP:door_hinge dxf2bim/std2d.js
GAP:door_host_ambiguous dxf2bim/dxf2shell.js
GAP:door_no_strip dxf2bim/dxf2shell.js
GAP:door_part_ambiguous dxf2bim/dxf2bim.js
GAP:door_swing dxf2bim/std2d.js
GAP:duplicate_footprint dxf2bim/dxf2bim.js
GAP:elevation_height_conflict dxf2bim/dxf2elev.js
GAP:fan_degenerate dxf2panels.js
GAP:fill_no_void dxf2bim/dxf2shell.js
GAP:fill_size_mismatch dxf2bim/dxf2shell.js
GAP:fill_unbound dxf2bim/dxf2shell.js
GAP:foundation_storey dxf2bim/std2d.js
GAP:gap_height_conflict dxf2bim/dxf2shell.js
GAP:hatch_edge_unsupported dxf2hatch.js
GAP:hatch_empty_path dxf2hatch.js
GAP:hatch_loop_open dxf2hatch.js
GAP:label_ dxf2pair.js
GAP:label_ambiguous dxf2bim/dxf2types.js
GAP:label_conflict dxf2bim/dxf2types.js
GAP:label_no_match dxf2pair.js
GAP:label_sheets_not_alignable dxf2pair.js
GAP:label_unknown_text dxf2bim/dxf2types.js
GAP:label_unmatched dxf2bim/dxf2types.js
GAP:layers_sum_mismatch dxf2bim/dxf2types.js
GAP:lod400_ambiguous dxf2bim/dxf2shell.js
GAP:lod400_envelope dxf2bim/dxf2shell.js
GAP:lod400_library_unreachable dxf2bim_import.js, dxf_import_ui.js
GAP:lod400_mesh_missing dxf2bim_import.js
GAP:lod400_not_in_subset dxf2bim_import.js
GAP:lod400_orientation dxf2bim/dxf2shell.js
GAP:net_degenerate dxf2panels.js
GAP:no_colour dxf2structure.js
GAP:no_dimension dxf2bim/dxf2bim.js, dxf2bim/dxf2types.js
GAP:no_elevation_for_face dxf2bim/dxf2elev.js
GAP:no_elevation_height dxf2bim/dxf2elev.js, dxf2bim/dxf2qualify.js, dxf2bim/dxf2shell.js, dxf_meta_editor.js
GAP:no_elevation_match dxf2bim/dxf2elev.js
GAP:no_fill_geometry dxf2bim/dxf2mesh.js
GAP:no_geometry dxf2bim/dxf2mesh.js
GAP:no_height dxf2bim/dxf2mesh.js, dxf2bim/dxf2shell.js
GAP:no_host dxf2bim/dxf2bim.js
GAP:no_host_cut dxf2bim/dxf2bim.js, dxf2bim/dxf2qualify.js, dxf_meta_editor.js
GAP:no_lod400_geometry dxf2bim/dxf2shell.js
GAP:no_roof_storey dxf2bim/std2d.js
GAP:opening_gap_unbounded dxf2bim/dxf2shell.js
GAP:opening_host_no_geometry dxf2bim/std2d.js
GAP:opening_host_not_cut dxf2bim/std2d.js
GAP:opening_host_not_orthogonal dxf2bim/std2d.js
GAP:opening_host_not_wall dxf2bim/std2d.js
GAP:opening_in_polygon_wall dxf2bim/dxf2mesh.js
GAP:opening_inside_piece dxf2bim/dxf2shell.js
GAP:opening_no_host dxf2bim/std2d.js
GAP:opening_outside_wall dxf2bim/dxf2mesh.js, dxf2bim/dxf2shell.js
GAP:opening_overlap dxf2bim/dxf2mesh.js
GAP:opening_unclassified dxf2bim/dxf2bim.js, dxf2bim/dxf2qualify.js
GAP:panel_axis dxf2panels.js
GAP:panel_degenerate dxf2panels.js
GAP:panel_elevation_not_aligned dxf2panels.js
GAP:panel_face dxf2panels.js
GAP:panel_hole_unsupported dxf2panels.js
GAP:panel_label_ambiguous dxf2panels.js
GAP:panel_label_height dxf2panels.js
GAP:panel_no_grid dxf2panels.js
GAP:panel_no_plan dxf2panels.js
GAP:panel_no_thickness dxf2panels.js
GAP:panel_thickness_ambiguous dxf2panels.js
GAP:pipeline_not_run dxf2bim_import.js
GAP:plate_degenerate dxf2section.js
GAP:plate_no_thickness dxf2section.js
GAP:roof_bad_thickness dxf2bim/dxf2shell.js
GAP:roof_bottom_conflict dxf2bim/dxf2shell.js
GAP:roof_hole_not_rect dxf2bim/dxf2shell.js
GAP:roof_hole_outside dxf2bim/dxf2shell.js
GAP:roof_no_bottom dxf2bim/dxf2shell.js
GAP:roof_no_outline dxf2bim/dxf2shell.js
GAP:roof_no_top dxf2bim/dxf2shell.js
GAP:roof_outline_mismatch dxf2bim/dxf2shell.js
GAP:roof_top dxf2bim/std2d.js
GAP:roof_top_conflict dxf2bim/dxf2shell.js
GAP:roof_top_not_drawn dxf2bim/dxf2shell.js
GAP:schedule_cell_unassigned dxf2structure.js
GAP:schedule_conflict dxf2bim/dxf2types.js
GAP:schedule_title_inside_table dxf2notes.js
GAP:section_align_fail dxf2bim_import.js
GAP:section_bad_thickness dxf2bim/dxf2shell.js
GAP:section_cut dxf2section.js
GAP:section_no_bay dxf2bim/std2d.js
GAP:section_no_grid dxf2section.js
GAP:section_no_plan dxf2section.js
GAP:section_no_slab dxf2bim/dxf2shell.js
GAP:section_not_aligned dxf2section.js
GAP:section_not_rect dxf2bim/dxf2shell.js
GAP:section_roof_conflict dxf2bim/dxf2shell.js
GAP:section_roof_top_conflict dxf2bim/dxf2shell.js
GAP:section_slab_conflict dxf2bim/dxf2shell.js
GAP:slab_bad_thickness dxf2bim/dxf2shell.js
GAP:slab_inner_face_conflict dxf2bim/dxf2shell.js
GAP:slab_no_exterior_wall dxf2bim/dxf2shell.js
GAP:slab_no_top dxf2bim/dxf2shell.js
GAP:slab_no_underside dxf2bim/dxf2shell.js
GAP:slab_top_conflict dxf2bim/dxf2shell.js
GAP:slab_underside_conflict dxf2bim/dxf2shell.js
GAP:storey_name_duplicate dxf2bim/std2d.js
GAP:storey_no_walls dxf2bim/std2d.js
GAP:synth_column_belowgrade_not_square dxf2notes.js
GAP:synth_column_belowgrade_unreadable dxf2notes.js
GAP:synth_column_levels dxf2synth.js
GAP:synth_column_no_footing dxf2synth.js
GAP:synth_no_grid dxf2synth.js
GAP:synth_no_plan dxf2synth.js
GAP:synth_roof_no_gable dxf2synth.js
GAP:synth_roof_one_end dxf2synth.js
GAP:synth_slab_no_columns dxf2synth.js
GAP:type_binding_conflict dxf2bim/dxf2types.js
GAP:type_request_incomplete dxf2bim/dxf2types.js
GAP:type_size_mismatch dxf2bim/dxf2types.js
GAP:type_unbound dxf2bim/dxf2types.js
GAP:type_unknown dxf2bim/dxf2types.js
GAP:unclosed dxf2bim/dxf2bim.js
GAP:unknown_block dxf2bim/dxf2bim.js
GAP:unmapped_layer dxf2bim/dxf2bim.js, dxf2bim/dxf2qualify.js
GAP:unsupported_entity dxf2bim/dxf2bim.js
GAP:wall_base_from_plan_level dxf2bim/dxf2shell.js
GAP:wall_below_min_thickness dxf2bim/dxf2bim.js
GAP:wall_footprint_not_rect dxf2bim/dxf2bim.js
GAP:wall_line_diagonal dxf2bim/dxf2bim.js
GAP:wall_line_unpaired dxf2bim/dxf2bim.js
GAP:wall_mode_mismatch dxf2bim/dxf2bim.js
GAP:wall_not_footprint dxf2bim/dxf2bim.js
GAP:wall_not_orthogonal dxf2bim/std2d.js
GAP:wall_orientation_ambiguous dxf2bim/dxf2bim.js
GAP:wall_pair_ambiguous dxf2bim/dxf2bim.js
GAP:window_no_host dxf2bim/std2d.js
GAP:wing_no_walls dxf2bim/std2d.js
GAP:zero_length dxf2bim/dxf2bim.js
MARK:align_fail dxf2bim/dxf2marks.js
MARK:axis_cut dxf2bim/dxf2marks.js
MARK:axis_face dxf2bim/dxf2marks.js
MARK:by_invalid dxf2bim/dxf2marks.js
MARK:conflict dxf2bim/dxf2marks.js
MARK:layer_type dxf2bim/dxf2marks.js
MARK:level_scale_fail dxf2bim/dxf2marks.js
MARK:malformed dxf2bim/dxf2marks.js
MARK:missing dxf2bim/dxf2marks.js, dxf2bim/dxf2qualify.js, dxf2bim_import.js, dxf_meta_editor.js
MARK:set_mismatch dxf2bim/dxf2marks.js
MARK:unknown_key dxf2bim/dxf2marks.js
MARK:view_ambiguous dxf2bim/dxf2marks.js
QF:check_skipped dxf2bim/dxf2qualify.js
QF:convention_applied dxf2bim/dxf2qualify.js, dxf_meta_editor.js
QF:dim_missing dxf2bim/dxf2qualify.js
QF:dim_not_entity dxf2bim/dxf2qualify.js
QF:dim_note dxf2bim/dxf2qualify.js
QF:dim_override_equal dxf2bim/dxf2qualify.js
QF:dim_point_missing dxf2bim/dxf2qualify.js
QF:dim_text_mismatch dxf2bim/dxf2qualify.js
QF:dim_text_unreadable dxf2bim/dxf2qualify.js
QF:elev_align_fail dxf2bim/dxf2qualify.js
QF:elev_grid_missing dxf2bim/dxf2qualify.js
QF:elev_height_dim_missing dxf2bim/dxf2qualify.js
QF:elev_level_mismatch dxf2bim/dxf2qualify.js
QF:elev_roof_unstated dxf2bim/dxf2qualify.js
QF:face_no_elev dxf2bim/dxf2qualify.js
QF:grid_label_conflict dxf2bim/dxf2qualify.js
QF:grid_label_dup dxf2bim/dxf2qualify.js
QF:grid_label_order dxf2bim/dxf2qualify.js
QF:grid_label_series dxf2bim/dxf2qualify.js
QF:grid_line_skew dxf2bim/dxf2qualify.js
QF:grid_missing dxf2bim/dxf2qualify.js
QF:grid_off_axis dxf2bim/dxf2qualify.js
QF:grid_unlabelled dxf2bim/dxf2qualify.js
QF:height_stated dxf2bim/dxf2qualify.js, dxf_meta_editor.js
QF:layer_unmapped dxf2bim/dxf2qualify.js
QF:mark_invalid dxf2bim/dxf2qualify.js
QF:mark_missing dxf2bim/dxf2qualify.js
QF:no_bodies dxf2structure.js
QF:plan_level_duplicate dxf2bim/dxf2qualify.js
QF:plan_no_level dxf2bim/dxf2qualify.js
QF:roof_level_mismatch dxf2bim/dxf2qualify.js
QF:scope_duplicate_piece dxf2bim_import.js
QF:scope_gap dxf2bim_import.js
QF:scope_grid_disagree dxf2bim_import.js
QF:scope_level_conflict dxf2bim_import.js
QF:scope_no_key dxf2bim_import.js
QF:scope_overlap dxf2bim_import.js
QF:set_mismatch dxf2bim/dxf2qualify.js
QF:set_no_plan dxf2bim/dxf2qualify.js
QF:set_no_roof dxf2bim/dxf2qualify.js
QF:set_storey_unstated dxf2bim/dxf2qualify.js
QF:setting_missing dxf2bim/dxf2qualify.js
QF:sheet_no_role dxf2bim/dxf2qualify.js
QF:units_conflict dxf2bim/dxf2qualify.js
QF:units_unstated dxf2bim/dxf2qualify.js
QF:walltop_unknown_storey dxf2bim/dxf2qualify.js