MKI_ENTITY_INSTANCE (Entity Classes) Changed in Version 2021.1

www.CAD6.com

C++ Syntax

class MKI_ENTITY_INSTANCE : public MKI_ENTITY_BASE

{

  public:

 

  MKI_XPROPERTY m_cXProperty;

  MKI_LIBRARYNAME m_szLibraryName;

  MKI_BLOCKNAME m_szBlockName;

  MKI_COMMENTLONG m_szComment;

  MKI_MATRIX m_cDisplayMatrix;

  __int32 m_nDisplayMode;

  MKI_ENTITY_BLOCK_PTR m_pBlock;

  __int32 m_nListIndex,

          m_nBlockIndex;

 

  char m_pData[];

 

  bool

  IsIntern( void ) const;

 

  bool

  IsGroup( void ) const;

 

  bool

  IsPosNo( void ) const;

 

  MKI_BLOCK_ATTRIBUTE_PTR

  GetPosNo( void );

};

 

This structure describes an entity of type MKI_ENTITYTYPE_INSTANCE, i.e. a block instance. Header.EntityType must be MKI_ENTITYTYPE_INSTANCE (1).

 

Element Description

XProperty

[MKI_XPROPERTY] Properties of the instance including transmission.

LibraryName Changed in Version 2019.1

[MKI_LIBRARYNAME] Name of the library containing the desired block, maximum 63 characters. If the instance references a block located in the same drawing / library as the instance, set this name to MKI_BLOCK_ID ("*").

BlockName Changed in Version 2019.1

[MKI_BLOCKNAME] Name of the block, maximum 255 characters. If the first character is 0x00, this instance is invalid and will neither be loaded nor stored! If the first character is '#' (Ansi 35), the block is a special, internally used and handled block (see MKI_ENTITY_BLOCK).

Comment Changed in Version 2019.1

[MKI_COMMENTLONG] Arbitrary comment text for this instance.

DisplayMatrix

[MKI_MATRIX] Display matrix of the block. All entities stored in the block have to be multiplied with this matrix before display. It contains translation, rotation, scaling and distortion.

DisplayMode

[__int32] Bit-wise OR combination of some flags indicating the display mode for blocks. Possible values are (see MKI_DISPLAYMODE_*):

MKI_DISPLAYMODE_DEFAULT

MKI_DISPLAYMODE_SCALED_WIDTH

MKI_DISPLAYMODE_CONFINED

MKI_DISPLAYMODE_NOGEO

MKI_DISPLAYMODE_ADAPT_ANGLE

MKI_DISPLAYMODE_SCALED_LENGTH

MKI_DISPLAYMODE_EMBEDDED

MKI_DISPLAYMODE_ADAPT_SCALE

MKI_DISPLAYMODE_NOHIDE New in Version 2021.1

Block

[MKI_ENTITY_BLOCK_PTR] Current address of the block pointed to. This value must not be modified!

ListIndex,

BlockIndex

[__int32] Zero-based indexes of the block in the internal caches. These values must not be modified!

Data

[char[]] This data section contains a list of data blocks (see Data Blocks). The data section of an instance only contains local and, in case of an embedded block, global attributes (see MKI_BLOCK_ATTRIBUTE), followed by an end-of-list data block (MKI_DB_END).

 

Attributes New in Version 2021.0

An instance may contain attribute data blocks (see MKI_BLOCK_ATTRIBUTE) of type "local" and (only if embedded) of type "global". Attributes of types "outline", "point", and (if not embedded) "global" must not exist. The total number of attributes per instance is limited to MKI_ATTRIBS_PER_OBJECT.

 

MKD Syntax

This entity represents an instance (internal or external reference) of a block. It is used to reference and display a block definition. An entity of type "Instance" has the following structure:

 

0,EntityOwner,1,UniqueID,XProperty,

LibraryName,BlockName,Comment,DisplayMatrix,DisplayMode;

-Data Block List-

,999,0,0;

-Entity Link List-

,,999,,"";

 

Element Description

EntityOwner

[__int16] This value is a unique identification of the plug-in that created the entity. The value MKI_DB_OWNER_MK is reserved for use by Malz++Kassner, especially for objects and data blocks that are created and handled directly by the application. Valid range: 0 <= Value < 10000.

Third-party vendors that plan to implement a plug-in should contact Malz++Kassner to receive their unique identification (see Getting Your Private Owner ID).

-Data Block List-

The data block list contains a list of data blocks (see Data Blocks). Currently, instances only contain local attributes. This may change in further releases, so be prepared to find global attributes and other data blocks in this section.

-Entity Link List-

The entity link list contains the extended object's sub-entity link-list ("link data") as defined by Header.LinkFirst and Header.LinkLast. Currently, this list is usually empty (except for maybe entities of extended object's link lists).

 

Examples

|Header,XProperty|

0,0,1,"",64,0,0,0/0/0,0/0/0,0.0,0,0,1,

|LibraryName|

"*",

|BlockName|

"Furniture\Living Room\Sideboard",

|Comment|

"2015-04-21",

|DisplayMatrix,DisplayMode|

2.0,0.0,0.0,2.0,0.0,0.0,0;

|B400|

0,400,0,500,"Material","Pine",

|B999|

0,999,0,0;

 

This instance inserts the block "Furniture\Living Room\Sideboard" that has been introduced in the chapter Entity "Block". As the block is an internal block of the drawing, and not an external block in a library, LibraryName is set to MKI_BLOCK_ID ("*"). The layer index 1 is transmitted to all entities of the block, the block will be displayed at location (0.0,0.0), scaled by factor 2.0.

 

The instance has received the local attribute "Material" from the block's definition, its content was changed from "Oak" to "Pine" either during creation of the instance or later by explicit editing of the user.

 

|HeaderType,XProperty|

0,0,1,"",0,0,0,0/0/0,0/0/0,0.0,0,0,0,

|LibraryName|

"Screws",

|BlockName|

"Cylinder Screws\DIN 912\M8",

|Comment|

"",

|DisplayMatrix,DisplayMode|

-1.0,0.0,0.0,-1.0,10.0,-7.0,0;

|B999|

0,999,0,0;

 

This instance inserts the external block "M8" of the library "Screws". It is placed in the subfolder "DIN 912" which is located in the folder "Cylinder Screws". The entities of the block will be displayed with their own properties (XProperty.Flag = MKI_USE_NULL). The block will be displayed at the location (10.0,-7.0), rotated by 180°. This instance does not own any attribute.

 

CAD6interface 2024.2 - Copyright 2024 Malz++Kassner® GmbH