MLightCAD
    Preparing search index...

    Options for opening a CAD database.

    This interface extends the base options from the data model but replaces the readOnly property with a mode property that provides more granular access control.

    Inherits AcDbOpenDatabaseOptions.drawNoPlotLayers and AcDbOpenDatabaseOptions.failOnFontLoadError from the data model. AcApDocManager defaults drawNoPlotLayers to false (web viewer semantics) when omitted. Font load failures do not abort the read unless failOnFontLoadError is true.

    const options: AcApOpenDatabaseOptions = {
    mode: AcEdOpenMode.Write,
    fontLoader: myFontLoader
    };
    interface AcApOpenDatabaseOptions {
        drawNoPlotLayers?: boolean;
        failOnFontLoadError?: boolean;
        fileName?: string;
        fontLoader?: AcDbFontLoader;
        minimumChunkSize?: number;
        mode?: AcEdOpenMode;
        openViewMode?: AcApOpenViewMode;
        progressiveRendering?: boolean;
        sysVars?: Record<string, string | number | boolean>;
        timeout?: number;
    }

    Hierarchy

    • Omit<AcDbOpenDatabaseOptions, "readOnly">
      • AcApOpenDatabaseOptions
    Index

    Properties

    drawNoPlotLayers?: boolean

    Whether entities on non-plottable ("no-plot") layers are drawn.

    • true (default): desktop AutoCAD editor semantics ??no-plot layers remain visible on screen (Defpoints, viewport frames on *-NPLT, etc.).
    • false: web/publish viewer semantics (e.g. BIM 360 / ACC) ??entities on no-plot layers are omitted from display.
    failOnFontLoadError?: boolean

    When true, aborts AcDbDatabase.read if fontLoader fails.

    Defaults to false so unreachable font CDNs do not block entity parsing.

    fileName?: string

    File name of the drawing being opened, including extension (for example Plan.dwg).

    When provided, updates the read-only DWGNAME system variable for this database.

    fontLoader?: AcDbFontLoader

    Loader used to load fonts used in the drawing database.

    This loader will be used to load any fonts referenced by text entities in the drawing database. By default, font load failures are logged and parsing continues without the missing fonts. Set failOnFontLoadError to true to abort the read when font loading fails.

    minimumChunkSize?: number

    The minimum number of items in one chunk.

    If this value is greater than the total number of entities in the drawing database, the total number is used. This controls how the database processing is broken into chunks for better performance.

    The access mode for opening the database. Higher value modes are compatible with lower value modes.

    • Read (0): Read-only access
    • Review (4): Review access, compatible with Read
    • Write (8): Full read/write access, compatible with Review and Read
    openViewMode?: AcApOpenViewMode

    How to frame the view when the document finishes opening.

    When omitted, Read and Review modes use AcApOpenViewMode.Extents; Write mode uses AcApOpenViewMode.Saved (AutoCAD VPORT behavior).

    progressiveRendering?: boolean

    Whether to render entities incrementally while a drawing is opening.

    When true, entity conversion is deferred across event-loop turns so geometry appears progressively and the camera can reframe as batches land. When false (default), conversion still runs asynchronously but the canvas is not redrawn until every entity is converted; zoom-to-fit also waits for conversion to finish.

    sysVars?: Record<string, string | number | boolean>

    System variables to override in the database.

    This allows overriding system variable values when opening a database. For example, to disable line weight display regardless of the database's stored value, set { 'lwdisplay': false }.

    The keys are system variable names (case-insensitive), and values can be number, boolean, or string types.

    timeout?: number

    Timeout for web worker parsing in milliseconds.

    This option is used only when the selected converter parses the drawing file in a web worker. If omitted, the converter-level timeout is used.