Table of Contents

Method Open

Namespace
GeometryHelper.Dwg
Assembly
GeometryHelper.dll

Open(string)

Opens a DWG file from a path as a drawing database, as Open(string) opens its DXF.

public static DxfDatabase Open(string path)

Parameters

path string

The path of the file.

Returns

DxfDatabase

The drawing. It has no file name of its own, and saving it writes a DXF.

Exceptions

ArgumentNullException

Thrown when the path is null.

FormatException

Thrown when the file is not a DWG, is cut short, or has a wrong check sum where nothing can be read past it.

NotSupportedException

Thrown when the DWG is of a version that is not read; the message names it.

IOException

Thrown when the file cannot be read.

Open(string, DxfReadOptions)

Opens a DWG file from a path as a drawing database, its SHAPEs named from the files of shapes in the folders of SupportFolders.

public static DxfDatabase Open(string path, DxfReadOptions options)

Parameters

path string

The path of the file.

options DxfReadOptions

How to read it: of the options, the database reads SupportFolders; null opens it as Open(string) does.

Returns

DxfDatabase

The drawing. It has no file name of its own, and saving it writes a DXF.

Exceptions

ArgumentNullException

Thrown when the path is null.

FormatException

Thrown when the file is not a DWG, is cut short, or has a wrong check sum where nothing can be read past it.

NotSupportedException

Thrown when the DWG is of a version that is not read; the message names it.

IOException

Thrown when the file cannot be read.

Open(Stream)

Opens a DWG file from a stream, from where the stream stands to its end, as a drawing database.

public static DxfDatabase Open(Stream stream)

Parameters

stream Stream

The stream; it is read to its end and left open.

Returns

DxfDatabase

The drawing. It has no file name of its own, and saving it writes a DXF.

Exceptions

ArgumentNullException

Thrown when the stream is null.

FormatException

Thrown when the data is not a DWG, is cut short, or has a wrong check sum where nothing can be read past it.

NotSupportedException

Thrown when the DWG is of a version that is not read; the message names it.