Class CadLinetypes
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
The linetypes of a document loaded, tested and drawn, as LINETYPE and its dialogs need them. A linetype of a file on disk is loaded by the library's own loader (LoadLineTypeFile(string, string)), which reads it as AutoCAD does, text and shapes alike; one of the presenter's own set is written from its definition (Add(DxfDatabase, CadLinetypeDefinition)).
public static class CadLinetypes
- Inheritance
-
CadLinetypes
- Inherited Members
Methods
- Add(DxfDatabase, CadLinetypeDefinition)
Writes a linetype of the presenter's own as an LTYPE record of a drawing, as AutoCAD writes one: its name, its description, 72 the alignment A, the count of its elements and its length, then each element's 49 and 74, and for a text its 75 of nought, the handle of its text style (340), its scale, rotation and offset (46, 50, 44, 45) and the text (9). GAS_LINE's gap of 5.08 carrying GAS in STANDARD is
49 -5.08, 74 2, 75 0, 340Standard's handle, 46 2.54, 50 0, 44 -2.54, 45 -1.27, 9 GAS. One of BuiltIn itself named like one of AutoCAD's (CENTER, HIDDEN, DASHED and the rest) is written in the drawing's units, as AutoCAD takes acad.lin or acadiso.lin by MEASUREMENT: CENTER in a metric drawing is31.75, -6.35, 6.35, -6.35and in one whose MEASUREMENT is 0 it is1.25, -0.25, 0.25, -0.25; any other definition is written as it is.
- DashesOf(DxfDatabase, string)
Gets the lengths of a linetype of the drawing, as its LTYPE holds them; none for Continuous or one the drawing has not.
- IsInUse(DxfDatabase, string)
Gets whether something of the drawing draws with a linetype, so that it may not be deleted: ByLayer, ByBlock and Continuous always, as AutoCAD keeps them, and any other an entity, a layer, a style or the header names, as the library's purge finds it.
- IsKept(string)
Gets whether a linetype is one AutoCAD keeps in every drawing: ByLayer, ByBlock or Continuous.
- Load(CadDocument, IEnumerable<CadLinetypeDefinition>, string, string)
Loads linetypes into a document as one undo step, named as given: each of a file on disk through the library's loader, each of BuiltInName from its definition; one the drawing has already passed over, one the drawing cannot take (its text style or shape missing) refused alone, the others loaded. DASHED of the presenter's own set loaded into a new drawing is an LTYPE of a dash 12.7 and a gap 6.35, 19.05 long. A linetype of BuiltIn itself is written from its definition whatever the path, so that the Load dialog's list, the presenter's own set followed by a file's, loads in one step.
- Names(DxfDatabase)
Gets the names of the drawing's linetypes, ByLayer and ByBlock left out, in the order of their names: Continuous, DASHED, HIDDEN.
- Rename(CadDocument, string, string)
Renames a linetype with everything drawn with it, as -RENAME LType does: the entities, the layers, the styles of multilines and the current linetype name it. Refused for ByLayer, ByBlock and Continuous, which AutoCAD keeps, and for a linetype of an external reference,
Cannot rename linetype "X".; for a name AutoCAD does not take,Invalid linetype name.; and for the name of another linetype, letters of either case the same,Linetype "X" already exists.