{"id":"image-x-vnd-dgn","mimeType":"image/x-vnd.dgn","name":"MicroStation Design File","shortName":"DGN","category":"CAD \u0026 Vector Graphics","extensions":[".dgn"],"description":"The image/x-vnd.dgn MIME type represents the MicroStation Design (DGN) file format. Originally developed in the 1980s by Intergraph as the Interactive Graphics Design System (IGDS) format, it was later heavily expanded and championed by Bentley Systems for their MicroStation CAD software. DGN is a highly complex 2D and 3D vector graphics format used primarily in the Architecture, Engineering, and Construction (AEC) industries for massive infrastructure projects, plant design, and civil engineering. The format underwent a massive architectural shift in 2000 with 'V8 DGN', which transitioned the file structure into a Microsoft OLE Compound Document container, completely breaking binary compatibility with the older, element-based 'V7 DGN'.","seo":{"title":"image/x-vnd.dgn MIME Type | Developer Reference for MicroStation DGN","description":"Complete reference for the image/x-vnd.dgn MIME type: Bentley MicroStation DGN format, AEC CAD modeling, V7 vs V8 architecture, and OLE structures.","faqs":[{"question":"What is a DGN file?","answer":"A DGN (Design) file is a 2D or 3D CAD drawing file used by construction and engineering professionals. It is the native format for Bentley MicroStation, similar to how DWG is the native format for Autodesk AutoCAD."},{"question":"What is the difference between DGN V7 and DGN V8?","answer":"DGN V7 (and earlier) is based on the original 16-bit Intergraph IGDS format with strict file size and element limitations. DGN V8, introduced in 2000, abandoned this structure entirely, utilizing a Microsoft OLE Compound File container to support virtually unlimited file sizes and double-precision coordinates."},{"question":"Can AutoCAD open DGN files?","answer":"Yes, modern versions of Autodesk AutoCAD have built-in utilities to import, export, and natively underlay (reference) MicroStation DGN files."}]},"index":{"compression":["Uncompressed","OLE Structured Storage"],"browserSupport":{"score":1,"label":"None"},"commonUses":["Civil Engineering and Plant Design","Large-scale Architecture and Construction (AEC)","2D/3D Infrastructure Modeling"]},"technical":{"magicBytes":{"hex":"D0 CF 11 E0 A1 B1 1A E1 (For V8 DGN)","ascii":"None (V7) / Microsoft OLE Signature (V8)"},"container":"Microsoft OLE Compound File (V8) / IGDS (V7)","compressionAlgorithm":["None"],"colorDepth":["Indexed Color (V7)","24-bit True Color (V8)"],"transparency":true,"animation":false,"metadata":{"exif":false,"xmp":false,"iccProfile":false},"alphaChannel":true,"progressiveLoading":false,"hdrSupport":false},"history":{"developer":"Intergraph (Originally) / Bentley Systems (Currently)","released":"1980","specification":"Proprietary (Documented via the Open Design Alliance)"},"browserSupport":{"chrome":false,"chromeVersion":"None","firefox":false,"firefoxVersion":"None","safari":false,"safariVersion":"None","edge":false,"edgeVersion":"None","internetExplorer":false},"softwareSupport":[{"name":"Bentley MicroStation","logo":""},{"name":"Autodesk AutoCAD","logo":""},{"name":"ODA (Open Design Alliance) Drawings Explorer","logo":""}],"conversion":{"convertTo":["dwg","dxf","svg"],"convertFrom":["dwg","dxf"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/vnd.dgn"},{"header":"Content-Type","value":"image/x-vnd.dgn"},{"header":"Content-Type","value":"application/x-dgn"}],"htmlAccept":"image/vnd.dgn, image/x-vnd.dgn, application/x-dgn, .dgn","fileDetection":["Detecting DGN files programmatically requires determining the version.","V8 DGN files use the Microsoft OLE Compound File format, meaning their first 8 bytes will exactly match legacy Microsoft Office documents (Hex: D0 CF 11 E0 A1 B1 1A E1). You must parse the internal OLE directory streams to verify it is a DGN and not a Word doc.","V7 DGN files (IGDS) do not have a standard magic header. They are composed of sequential 16-bit word elements. Parsers typically look for a Terminal Control Block (TCB) element near the beginning of the file to identify it as a valid V7 DGN."]},"prosCons":{"pros":["Exceptionally robust at handling massive, coordinate-heavy infrastructure models that would frequently crash older versions of competing CAD software","Deeply entrenched as the absolute standard format for many global departments of transportation and civil engineering firms","V8 architecture supports boundless design plane coordinates, eliminating the physical scaling limitations of V7"],"cons":["Deeply proprietary format requiring complex third-party libraries (like the ODA SDK) to parse or write programmatically outside of the Bentley ecosystem","V8's reliance on the archaic Microsoft OLE Compound File container makes file introspection cumbersome","Cannot be rendered natively in web browsers without converting to WebGL/Canvas formats or SVG"]},"specifications":{"url":"https://www.opendesign.com/guestfiles/open_dgn_specification","rfc":"","mimeAliases":["image/vnd.dgn","application/x-dgn","application/dgn"]},"developerSnippets":{"python":"import magic\n# Libmagic may identify V8 DGN files simply as 'Composite Document File V2 Document' due to the OLE header\nprint(magic.from_file('architecture.dgn', mime=True))","nodejs":"const fs = require('fs');\n// Sniffing for the Microsoft OLE signature used by V8 DGN files\nconst buffer = Buffer.alloc(8);\nconst fd = fs.openSync('architecture.dgn', 'r');\nfs.readSync(fd, buffer, 0, 8, 0);\nfs.closeSync(fd);\nconst isOLE = buffer[0] === 0xD0 \u0026\u0026 buffer[1] === 0xCF \u0026\u0026 buffer[2] === 0x11 \u0026\u0026 buffer[3] === 0xE0;\n// Note: If isOLE is true, further parsing of the internal streams is required to confirm it's a DGN and not an old .doc file\nconsole.log('Is OLE Container (Potential V8 DGN):', isOLE);","go":"import (\n    \"bytes\"\n    \"net/http\"\n    \"strings\"\n)\n// HTTP detection will likely return 'application/CDFV2' or 'application/octet-stream'\n// Relying on the .dgn extension is often necessary for quick routing\n// isDGN := strings.HasSuffix(strings.ToLower(filename), \".dgn\")","php":"$mime = mime_content_type('architecture.dgn');\necho $mime; // Standard PHP setups will often resolve V8 DGNs to 'application/vnd.ms-office' or 'application/CDFV2' because of the OLE header."},"relatedFormats":["dwg","dxf"]}
