Click or drag to resize

DXFReaderNETControlWriteDWG Method

Writes the current drawing to a DWG file on disk.

Namespace:  DXFReaderNET
Assembly:  DXFReaderNET (in DXFReaderNET.dll) Version: 20.12.2
Syntax
public bool WriteDWG(
	string DWGFileName = "",
	DxfVersion DXFVersion = DxfVersion.AutoCad2018,
	string BlockName = ""
)

Parameters

DWGFileName (Optional)
Type: SystemString
The name of the DWG file to be written with full path.
DXFVersion (Optional)
Type: DXFReaderNET.HeaderDxfVersion
The DWG version of the file (Default value: AutoCAD 2018 / AC1032).
BlockName (Optional)
Type: SystemString
If set the named block will be saved as a new drawing.

Return Value

Type: Boolean
True if successful.
Remarks
The drawing is written directly (AutoCAD R14 / AC1014 through AutoCAD 2018 / AC1032) without requiring the ODA File Converter. AutoCAD 2007 / AC1021 is written as AutoCAD 2004 / AC1018, and AutoCAD 2018 / AC1032 as AutoCAD 2010 / AC1024, because those DWG writer versions are more reliable. WriteDXF(String, DxfVersion, Boolean, String) also accepts a .dwg file name.
Examples
dxfReaderNETControl1.WriteDWG(@"C:\Drawings\sample.dwg");
See Also