MKI_ENTITY_BLOCK (Entity Classes) Changed in Version 2019.1 |
www.CAD6.com |
C++ Syntaxclass MKI_ENTITY_BLOCK : public MKI_ENTITY_BASE { public:
MKI_XPROPERTY m_cXProperty; MKI_BLOCKNAME m_szBlockName; MKI_COMMENTLONG m_szComment; MKI_RECT m_cBlockRect;
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_BLOCK, i.e. a block. Header.EntityType must be MKI_ENTITYTYPE_BLOCK (2).
Element DescriptionXProperty [MKI_XPROPERTY] Properties of the block including transmission (a block does usually not contain any transmission information unless explicitly enforced by the user). BlockName Changed in Version 2019.1 [MKI_BLOCKNAME] Name of the block, maximum 255 characters. If the first character of the block's name is 0x00, the block is invalid and will neither be loaded nor saved! This name must be unique among all block names of this drawing or library. If the first character of the block's name is '#' (Ansi 35), the block is a special, internally used and handled block (see comments section below). Comment Changed in Version 2019.1 [MKI_COMMENTLONG] Arbitrary comment text for this block. BlockRect [MKI_RECT] Rectangular frame surrounding the character cell, valid only if the block is a character inside a font library (see MKD Libraries). In this case, ( BlockRect.x1 / BlockRect.y1 ) is the lower left corner; ( BlockRect.x2 / BlockRect.y2 ) is the upper right corner of the cell. Data [char[]] This data section contains a list of data blocks (see Data Blocks). The data section of a block may only contain global and local attributes (see MKI_BLOCK_ATTRIBUTE), followed by an end-of-list data block (MKI_DB_END).
Attributes New in Version 2021.0A block may contain attribute data blocks (see MKI_BLOCK_ATTRIBUTE) of types "local" and "global". Attributes of types "outline" and "point" must not exist. The total number of attributes per block is limited to MKI_ATTRIBS_PER_OBJECT.
MKD SyntaxThis entity represents either an internal (inside a drawing file) or an external (inside a library file) block definition. Both definitions are handled similar, they both are a named collection of multiple entities, being referenced by instances (see Entity "Instance").
All entities inside a block are moved in a way that their origin (coordinates 0.0 / 0.0) is the desired "insertion point" of the block. The insertion point is entered by the user when creating a block, it determines the location he wants to enter later when inserting the block into a drawing.
Blocks are referred to by their names. Such a block name consists of folder names and the block name, assembled similar to file names. The folder names and the final block names are separated by a back-slash \ (Ansi 92). Each name element may be up to 255 characters long, the assembled block name may also be up to 255 characters long. A possible block name would be e.g. "Cylinder Screws\DIN 912\M8". This name describes a block named "M8", being located in the folder "DIN 912", which is a sub-folder of "Cylinder Screws".
An entity of type "Block" has the following structure:
0,EntityOwner,2,UniqueID,XProperty,BlockName,Comment,BlockRect; -Data Block List- ,999,0,0; -Entity Link List- ,,999,,"";
Element DescriptionEntityOwner [__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). BlockName Changed in Version 2019.1 [MKI_BLOCKNAME] Name of the block, maximum 255 characters. If the first character of the block's name is 0x00, the block is invalid and will neither be loaded nor saved! If the first character of the block's name is # (Ansi 35), the block is a special, internally used and handled block (see comments section below). -Data Block List- The data block list contains a list of data blocks (see Data Blocks). Currently, blocks only contain global and local attributes. This may change in further releases, so be prepared to find global attributes and other data blocks in this section. -Entity List- The entity list contains the block's list of entities ("block entity data") as defined by Header.LinkFirst and Header.LinkLast.
Example|Header,XProperty| 0,0,2,"",0,0,0,0/0/0,0/0/0,0.0,0,0,0, |BlockName| "Furniture\Living Room\Sideboard", |Comment| "2015-04-21", |BlockRect| -10.0,-5.0,10.0,5.0; |B301| 0,301,0,500,"Price","349.00"; |B400| 0,400,0,500,"Material","Oak"; |B999| 0,999,0,0;
This defines a block named "Sideboard", residing in the sub-folder "Living Room" of the folder "Furniture". The entities of this block will be displayed unmodified (XProperty.Flag = MKI_USE_NULL). The surrounding rectangle of the block (as calculated by the application when creating this block) is (10.0, 5.0, 10.0, 5.0). The block owns a global numeric attribute named "Price", its value is "135.00", and a local attribute named "Material" with a predefined value of "Oak".
CommentsBlocks whose name start with a # character (Ansi 35) are special. The function of such a block depends on the character following the # sign. Such a block is only allowed inside drawings, not inside libraries!
#G - Groups The name of an (old-style) group block must have the following form: "#G\ ..." (Ansi 35 71 92 ...) where "..." is a character sequence that identifies each group unequivocally. Usually, the application creates group names of the following form: "#G\sssss-sss-xxxxxxxxxxxxx"
The value "xxxxxxxxxxxxxx" is the current system time in milliseconds plus random digits, "sssss-sss" is the serial number of the application. This leads to a unique name used to refer to a group. Anyway, the user will usually have no need to know a group's name, as group are always handled directly by simply identifying them via mouse clicks.
Attention: Old-style groups are automatically maintained, i.e. they will be deleted as soon as no instance of them exists any more. This deletion will take place each time the drawing is loaded or saved.
#P - Position Number The name of an (old-style) position number block must have the following form: "#P\ ..." (Ansi 35 80 92 ...) where "..." is a character sequence that identifies each position number unequivocally. Usually, the application creates position number names of the following form: "#P\sssss-sss-xxxxxxxxxxxxx"
The value "xxxxxxxxxxxxxx" is the current system time in milliseconds plus random digits, "sssss-sss" is the serial number of the application. This leads to a unique name used to refer to a position number. Anyway, the user will usually have no need to know a position number's name, as position numbers are always handled directly by simple identifying them via mouse clicks.
These old-style groups and position numbers will usually be handled like "normal" blocks, i.e. they will appear in all dialogs used to select or modify blocks. The user will be able to select such a group or position number from the drawing's local library and insert it into the drawing.
|
CAD6interface 2024.2 - Copyright 2024 Malz++Kassner® GmbH