MKI_LINEDEF (Entity Data Classes) Changed in Version 2023.2

www.CAD6.com

C++ Syntax

class MKI_LINEDEF

{

  public:

 

  MKI_LINENAME m_szLineName;

  MKI_COMMENTSHORT m_szLineComment;

  __int32 m_nLineNum,

          m_nLineMode;

  double m_adLineData[MKI_LINEPART_MAX];

  MKI_LINEBLOCKDEF_PTR m_pLineBlock;

 

  MKI_LINEDEF( void );

 

  ~MKI_LINEDEF();

 

  void

  Init( void );

 

  void

  Exit( void );

 

  bool

  Attach( const MKI_LINEBLOCKDEF& f_rData );

 

  bool

  Copy( const MKI_LINEDEF& f_rClass );

 

  bool

  CopyToLibrary(

 const LPCWSTR f_pszLibraryName,

 const MKI_LINEDEF& f_rClass );

 

  bool

  CopyFromLibrary(

 const LPCWSTR f_pszLibraryName,

 const MKI_LINEDEF& f_rClass );

};

 

This structure contains a line type definition.

 

Element Description

m_szLineName Changed in Version 2019.1

[MKI_LINENAME] Name of the line type, up to 63 characters.

m_szLineComment New in Version 2023.2

[MKI_COMMENTSHORT] Comment on the line type, up to 63 characters.

m_nLineNum

[__int32] Number of pairs of "line" and "hole". Valid range: 0 <= Value <= MKI_LINEPART_MAX / 2. If this value is 0, the resulting line is a solid line.

m_nLineMode Changed in Version 6.0

[__int32] Definition mode of the line type (see MKI_LINETYPE_*). Supported values are:

MKI_LINETYPE_STANDARD

MKI_LINETYPE_ABSOLUTE

MKI_LINETYPE_USELINE

MKI_LINETYPE_USEBLOCK

m_adLineData Changed in Version 2013.0

[double[]] Partial line length pairs. Each line length may be between 1e-10 and 1e10 inclusive. The first value of each pair defines a "line", the second value defines a "hole". This list must contain exactly two times the number of line lengths as stated by the value stored in m_nLineNum. The scale of these values (either 1/100 times line width or 1/100 mm) is defined by m_nLineMode.

m_pLineBlock New in Version 6.0

[MKI_LINEBLOCKDEF_PTR] Address of the attached block line type definition. If nullptr, no block line type is attached.

 

MKD Syntax

The section =LINE= contains up to MKI_LINE_MAX line type definitions.

 

A line type contains two types of pattern definitions:

 

-A "partial line based" line type defines a sequence of "lines" and "holes" creating a periodical line type. In addition to some standard line types which are defined that way, this can be used to create custom line types. A line type definition does only determine the line-hole-sequence, other properties like line width or color have to be defined in a pen (see MKI_PENDEF).

 

-A "block based" line type defines a sequence of block creating a periodical line type. Each block has a determined distance to the next one.

 

Both types of line types can be combined. If both line type types are disabled, the line will be invisible.

 

The line type with the index 0 is named "*Standard" and is predefined by default as a solid line. This line type is valid throughout all drawings and libraries and does not occur in any MKD file.

 

Head of Section

=LINE=

TotalNum;

 

Entry for each Line Type Definition

LineName,LineIndex,

LineNum,LineMode,LineComment,

LineData[0],LineData[1] ... ,LineBlock;

 

End of Section

=END=;

 

If the section =LINE= does not exist, assume no line type to be defined (m_nTotalNum = 0).

 

Element Description

m_nTotalNum

[__int32] Number of line type definitions to follow. Valid range is 0 to MKI_LINE_MAX inclusive.

m_nLineIndex

[__int32] Index of the line type (1 to MKI_LINE_MAX). Each index may be assigned to one line type only, as this index is used internally to identify a line type.

m_cLineBlock New in Version 6.0

[MKI_LINEBLOCKDEF] This entry contains a complete block based line type definition. If no block based line type is used, this entry might contain only m_nBlockNum = 0 and m_nBlockMode = 0.

 

Example of a Line Type Definition

|Name,Index|

"Dash-dot-dot narrow DIN 15-G",4,

|Num,Mode,Comment|

3,0,"",

|Data|

4000,500,500,500,500,500;

 

This is the definition of the line type "Dash-dot-dot narrow DIN 15-G" having the index 4. It consists of three pairs of "line" and "hole", defined in 1/100 of the line's width. When drawing a 0.25 mm wide line using this line type, the result would be as follows:

 

 xxxxxxxx x x xxxxxxxx x x xxxxxxxx

    10   5×1.25  10   5×1.25  10 mm

 

CAD6interface 2024.2 - Copyright 2024 Malz++Kassner® GmbH