Table of Contents

Method Parse

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

Parse(string)

Opens a DXF file from its text, as ToText() or ToString() gives it.

public static DxfDatabase Parse(string text)

Parameters

text string

The text of the file.

Returns

DxfDatabase

The drawing, its text kept as the bytes AutoCAD would have saved it in.

Remarks

A text of R2007 or later, or one all ASCII, is kept as UTF-8. A string is text already read, so one of an earlier version with letters beyond ASCII is kept in the code page its header names ($DWGCODEPAGE, ANSI_1252 where it names none), as AutoCAD would have saved it, each letter the page lacks as its escape, and what is changed is written so too: an MTEXT café Đ in a text of R2004 of the page ANSI_1252 is saved as caf, the byte E9 and \U+0110, which AutoCAD 2021 reads as café Đ. Saved as the UTF-8 of the string, as the library did before, AutoCAD 2021 read é as é and refused a drawing with a layer of such a name. A file is best opened from its bytes all the same, which are kept as they are.

Exceptions

ArgumentNullException

Thrown when the text is null.

FormatException

Thrown when the text is not a DXF, is binary, or is cut short; the message names the line.