Table of Contents

Method LoadLineTypeFile

Namespace
GeometryHelper.Dxf
Assembly
GeometryHelper.dll

LoadLineTypeFile(string, string)

Loads linetypes from a file of linetypes, as AutoCAD's LoadLineTypeFile loads them from acad.lin: each linetype of the name given added to the LinetypeTable with its description and dashes, a dash's text or shape with its style, scale, rotation and offset, as DxfLinetypeTableRecord writes them.

public void LoadLineTypeFile(string lineTypeName, string filename)

Parameters

lineTypeName string

The name of the linetype, letters of either case the same, or a pattern of them.

filename string

The path of the file of linetypes.

Remarks

A linetype of the file is *NAME,description on a line and its pattern on the next: A, then the lengths of its dashes, above nought a dash, below a gap, nought a dot, and a dash's text or shape in brackets after it, ["GAS",STANDARD,S=.1,U=0.0,X=-0.1,Y=-.05] or [CIRC1,ltypeshp.shx,x=-.1,s=.1]; a line that begins with a semicolon is a comment. AutoCAD's gas line, A,.5,-.2,["GAS",STANDARD,S=.1,U=0.0,X=-0.1,Y=-.05],-.25, is three dashes and 0.95 long, its gap of 0.2 carrying the text GAS, written 49 -0.2, 74 2, 75 0, 340 the handle of Standard, 46 0.1, 50 0, 44 -0.1, 45 -0.05, 9 GAS. A rotation R or U is from the line and A from the x axis, in degrees, or radians with r after it, grads with g.

A text is drawn in the text style the file names, which the drawing is to have. A shape is drawn from the file of shapes the file names, in the drawing's style of that file, added with no name (70 of 1) where it has none, as AutoCAD adds one; a shape named rather than numbered is found by its name in that compiled file (.shx), in the folder of the file of linetypes. A file of R12 has no complex linetypes.

The name may hold the wildcards * and ?, * loading every linetype of the file: those the drawing has already, and those it cannot take (a style or shape it has not, more than 12 dashes), are passed over, the log saying which in one line. A name with no wildcard is loaded or refused.

Exceptions

ArgumentNullException

Thrown when the name or the path is null.

ArgumentException

Thrown, for a name with no wildcard, when the file has no linetype of the name or cannot be read there, the drawing has a linetype of the name already (AutoCAD's eDuplicateRecordName), or the linetype is one the drawing cannot take: a text style it has not, a shape not found, more than 12 dashes, a complex linetype in a file of R12 or in one that writes no handles to point at its styles by, or no linetype table to hold it. Every dash is checked first, so that a linetype refused adds nothing, not even the style of a file of shapes.

IOException

Thrown when the file cannot be read, a FileNotFoundException where there is none.