Method Read
- Namespace
- GeometryHelper.Dwg
- Assembly
- GeometryHelper.dll
Read(string, DxfReadOptions)
Reads a DWG file from a path into the library's shapes, as Read(string, DxfReadOptions) reads its DXF.
public static DxfDocument Read(string path, DxfReadOptions options = null)
Parameters
pathstringThe path of the file.
optionsDxfReadOptionsHow to read it; null reads it with the defaults of DxfReadOptions.
Returns
- DxfDocument
The entities of the file and what it says of itself.
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.
Read(Stream, DxfReadOptions)
Reads a DWG file from a stream, from where the stream stands to its end.
public static DxfDocument Read(Stream stream, DxfReadOptions options = null)
Parameters
streamStreamThe stream; it is read to its end and left open.
optionsDxfReadOptionsHow to read it; null reads it with the defaults of DxfReadOptions.
Returns
- DxfDocument
The entities of the file and what it says of itself.
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.