Class DwgDocument
- Namespace
- DwgIO
- Assembly
- DwgIO.dll
An opened Autodesk DWG file parsed without AutoCAD installed. Exposes version info, the named-section catalog and per-section decompressed reads.
public sealed class DwgDocumentInheritance
Inherited Members
Properties
AppInfo
Producer information from AcDb:AppInfo, when present.
public DwgAppInfo? AppInfo { get; }Property Value
ContainerHeader
The decrypted file header (R2004-family files only).
public DwgContainerHeader? ContainerHeader { get; }Property Value
Diagnostics
Best-effort parse failures collected while opening (section name → message).
public IReadOnlyList<string> Diagnostics { get; }Property Value
Entities
Decoded entities with geometry (LINE/CIRCLE/ARC/POINT) — requires ReadObjects.
public IReadOnlyList<DwgEntity> Entities { get; }Property Value
FileDepList
External file dependencies from AcDb:FileDepList, when present.
public DwgFileDepList? FileDepList { get; }Property Value
FileHeader
The parsed 128-byte shared file prefix (version, maintenance version, codepage).
public DwgFileHeader FileHeader { get; }Property Value
FileSize
Size of the file in bytes.
public long FileSize { get; }Property Value
HandleMap
Handle→offset index from AcDb:Handles (R2004-family files, ReadObjects on).
public DwgHandleMap? HandleMap { get; }Property Value
Objects
Object inventory from AcDb:AcDbObjects (framing + identity, bodies decode later).
public IReadOnlyList<DwgObjectInfo> Objects { get; }Property Value
PageCount
Number of pages in the global page map (R2004-family files only).
public int? PageCount { get; }Property Value
- int?
Path
Absolute or relative path the document was opened from.
public string Path { get; }Property Value
Preview
Embedded thumbnail from AcDb:Preview, when present.
public DwgPreview? Preview { get; }Property Value
Sections
Named sections of the container, in section-map order (R2004-family files).
public IReadOnlyList<DwgSectionInfo> Sections { get; }Property Value
SummaryInfo
Drawing metadata from AcDb:SummaryInfo, when the section exists (R2004-family files).
public DwgSummaryInfo? SummaryInfo { get; }Property Value
Version
The DWG release identified from the file's version magic.
public DwgVersionInfo Version { get; }Property Value
Methods
Open(string, DwgReaderOptions?)
Opens and parses a DWG file.
public static DwgDocument Open(string path, DwgReaderOptions? options = null)Parameters
pathstringoptionsDwgReaderOptions?
Returns
Exceptions
- FileNotFoundException
-
The file does not exist.
- DwgUnsupportedVersionException
-
The file's container is not implemented yet (R13-R2000, R2007).
- DwgException
-
The file is corrupt or truncated.
ReadSection(string)
Reads and decompresses a named section (e.g. "AcDb:Header", "AcDb:SummaryInfo").
public byte[] ReadSection(string name)Parameters
namestring
Returns
- byte[]