Class CadDrawingFile
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
The drawing files the presenter opens, attaches and inserts: a DWG, read by DwgReader, of AutoCAD 2000 to 2018, and a DXF. A file is read as a DWG where its first bytes say so ("AC1032" for AutoCAD 2018), whatever its name; a drawing saved to a name ending in .dwg is written by DwgWriter as a DWG of AutoCAD 2018, or of the older version asked for (2013, 2010, 2007, 2004 or 2000), any other name as a DXF.
public static class CadDrawingFile
- Inheritance
-
CadDrawingFile
- Inherited Members
Fields
- OpenFilter
The filter of the file dialogs that pick a drawing, DWG first as in AutoCAD 2021's Select File: Drawing (.dwg), DXF (.dxf), All files (.).
Methods
- IsDrawingName(string)
Gets whether a file's name ends in .dwg or .dxf, of either case: plan.dwg and PLAN.DXF, not plan.dwt.
- IsDwg(string)
Gets whether a file is a DWG: its first six bytes AC1 and three more digits, as "AC1015" of AutoCAD 2000 and "AC1032" of AutoCAD 2018 are. A DXF, of text or binary, never starts so.
- Open(string)
Reads a drawing file as a database: a DWG by Open(string), any other file by Open(string).
- 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.