MKI_BLOCK_ATTRIBUTE (Data Block Classes) Changed in Version 2021.0 |
www.CAD6.com |
C++ Syntaxclass MKI_BLOCK_ATTRIBUTE : public MKI_BLOCK_BASE { public:
MKI_ATTRIBUTENAME m_szName; wchar_t m_pText[]; };
This structure describes a data block storing attributes.
Element DescriptionHeader [MKI_BLOCK_HEADER] This structure contains general information about the data block. The ElemType element is to be set to MKI_DB_TYPE_NATIVE (0), the BlockType element to any data block attribute type (see MKI_DB_ATTRIB_*). Name Changed in Version 2019.1 [MKI_ATTRIBUTENAME] Name of the attribute, up to 31 characters. Value Renamed in Version 2021.0 [wchar_t[]] Content of the attribute.
You should make sure that all attributes of one type within one area are named different from each other. Otherwise, they cannot be identified safely and might get lost. It's no problem to have a "local" attribute with the same name as an "outline" or "point" attribute, but the more specific attribute will logically overwrite the more general attribute.
MKD SyntaxMost entity types can contain explicit attributes. An explicit attribute is a named text containing information and is assigned to an entity to be processed later on, e.g. to create a parts list or to create any other kind of statistic.
Explicit attributes can be either "global" or "local". Global attributes can be assigned to block definitions and are valid for all instances of that block, i.e. they are equal for all instances. Local attributes can be assigned to block definitions and to instances. Inside a block definition, a local attribute is only a "recommandation", that means such a local attribute indicates that it could be assigned to any instance of this very block. Inside the instance local attributes are valid only for this single instance. This can lead to different values of a local attribute in several instances of the same block.
Both global and local attributes may either be of type "Text" or "Number". Attributes of type "Text" may contain any text of up to MKI_LENGTH_ATTRIBUTE characters in length, whereas attributes of type "Number" must contain a valid numeric value.
Each entity may contain up to MKI_ATTRIBS_PER_OBJECT attributes. As attributes are referenced to by their names, these names have to be unique.
Explicit attributes are stored in Native Data Blocks, using the following data structure:
BlockOwner,BlockType,0,ElemCount,Name,Value;
Element DescriptionBlockOwner [__int16] This value is a unique identification of the creator of the plug-in that created the data block. 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). BlockType [__int16] This value indicates the type of attribute that is stored in the data block (see MKI_DB_ATTRIB_*). ElemCount [__int16] Maximum attribute length to be stored in this data block. If the value is positive, only the number bytes actually needed to store the current attribute will be allocated. This saves memory, but requires a reorganisation of the data block structure each time the attribute is altered.
Value Renamed in Version 2021.0 [wchar_t[]] Attribute to be stored in form of a UTF-16 text, maximum length according to ElemCount. Attributes of entities owned by Malz++Kassner may not be longer than MKI_LENGTH_ATTRIBUTE bytes, i.e. ElemCount should be set to MKI_LENGTH_ATTRIBUTE.
|
CAD6interface 2024.2 - Copyright 2024 Malz++Kassner® GmbH