CadLinetypeFile
from OpenCAD2D import CadLinetypeFile
class CadLinetypeFile(System.Object) ยท CadLinetypeFile in the .NET reference
Reads .lin files into CadLinetypeDefinitions as AutoCAD reads them, and carries the presenter's own set of linetypes (CadLinetypeFile.BuiltIn), the default. No file of AutoCAD's is carried or looked for: a .lin file is read only where the user names it or keeps it in a support folder of their own (CadSupportFiles).
Properties and fields
BuiltInName
BuiltInName: ClassVar[str]
The name the presenter's own set goes by in the dialogs and on the command line: no file has it on disk.
BuiltIn
BuiltIn: ClassVar[System.Collections.Generic.IReadOnlyList[CadLinetypeDefinition]]
Gets the presenter's own 39 linetypes, in millimetres: DASHED, HIDDEN, CENTER, PHANTOM, DOT, DASHDOT, DIVIDE and BORDER, each with its half size (DASHED2) and double size (DASHEDX2); ACAD_ISO02W100 to ACAD_ISO15W100; and GAS_LINE. Continuous is not among them, as every drawing has it. Loaded into a drawing whose MEASUREMENT is 0 the first 24 and GAS_LINE take their lengths in inches instead (CadLinetypes.Add).
Methods
Parse
@staticmethod
def Parse(text: str) -> System.Collections.Generic.IReadOnlyList[CadLinetypeDefinition]
Reads the linetypes of the text of a .lin file, in its order: each opened by *NAME,description, its pattern on the next line that is not blank or a comment (;), A, and its elements. A linetype whose pattern cannot be read is given with its CadLinetypeDefinition.Fault, as AutoCAD refuses it alone.
ParsePattern
@staticmethod
def ParsePattern(name: str, description: str, pattern: str) -> CadLinetypeDefinition
Reads a pattern typed as -LINETYPE Create takes it, A,6,-1.5 or 6,-1.5, into a linetype of the name and description given; the fault said where it cannot be read.
Read
@staticmethod
def Read(path: str) -> System.Collections.Generic.IReadOnlyList[CadLinetypeDefinition]
Reads a .lin file: UTF-8 where its bytes are, else each byte its own character, as AutoCAD's own files are written in the code page of Windows.