Method Open
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
Open(string)
Reads a drawing file as a database: a DWG by Open(string), any other file by Open(string).
public static DxfDatabase Open(string path)
Parameters
pathstringThe path of the file.
Returns
- DxfDatabase
The drawing.
Exceptions
- ArgumentNullException
Thrown when the path is null.
- IOException
Thrown when the file cannot be read.
- FormatException
Thrown when the file is a DWG that cannot be read.
- NotSupportedException
Thrown when the file is a DWG of a version that is not read, R14 among them; the message names it.
Open(string, IProgress<double>)
Reads a drawing file as a database, as Open(string) does, telling how far it has got as a share from 0 to 1: in thousandths, never going back, 0 first and 1 once read. A DWG of 100 000 lines tells it some 1 000 times as its objects are read and its DXF made; a DXF, read at once from its bytes, tells 0 and 1.
public static DxfDatabase Open(string path, IProgress<double> progress)
Parameters
pathstringThe path of the file.
progressIProgress<double>What is told how far it has got, on the thread that reads; null for nothing.
Returns
- DxfDatabase
The drawing.
Exceptions
- ArgumentNullException
Thrown when the path is null.
- IOException
Thrown when the file cannot be read.
- FormatException
Thrown when the file is a DWG that cannot be read.
- NotSupportedException
Thrown when the file is a DWG of a version that is not read, R14 among them; the message names it.