Click or drag to resize

DXFReaderNETControlReadDWG Method

Reads and displays a DWG file indicated by the FileName property or by the DWGFileName parameter.

Namespace:  DXFReaderNET
Assembly:  DXFReaderNET (in DXFReaderNET.dll) Version: 20.12.2
Syntax
public bool ReadDWG(
	string DWGFileName = "",
	bool DisplayAfterRead = true
)

Parameters

DWGFileName (Optional)
Type: SystemString
The name of the DWG file to be read with full path.
DisplayAfterRead (Optional)
Type: SystemBoolean
If set to false the drawing isn't displayed after read (Default value = true).

Return Value

Type: Boolean
True if read is successful.
Remarks
The current drawing is replaced. The DWG file is read directly (AutoCAD R14 / AC1014 through AutoCAD 2018 / AC1032) and loaded into the control as a DXF document. FileName and ReadDXF(String, Boolean) also accept .dwg files. Use WriteDWG(String, DxfVersion, String) to save a drawing as DWG.
Examples
dxfReaderNETControl1.ReadDWG(@"C:\Drawings\sample.dwg");
See Also