Data Blocks (File Format)

www.CAD6.com

Data blocks are the smallest information elements inside entities. Each data block starts with a sequence of three values: The data block owner identification, the data block element type (see MKI_DB_TYPE_*), and the data block type (see MKI_DB_POINT_*, MKI_DB_ALL_*, MKI_DB_INFO_*, and MKI_DB_ATTRIB_*). The values inside a data block are separated by a comma, the data block is ended with a semicolon.

 

The number of values inside a data block is variable. Even if a special data block is currently defined with a fixed number of values, it may grow in future. If so, new values will be appended to the data block, i.e. the currently defined values will remain at the same location. As a result, do always read all defined values of each data block, and then skip until the next semicolon to over-read unknown values.

 

Each entity may contain a variable number of data blocks of different type and length. This data block sequence is terminated by a data block of type 999. Data blocks of the same type do not always have the same length. Especially text and binary data varies in length!

 

If the description of an entity type states a specific data block sequence, this sequence must be maintained in any case. The usual sequence is:

-First, all point and generic data blocks (types 0 to 199, see MKI_DB_POINT_* and MKI_DB_ALL_*), possibly intertwined with outline and point attributes (types 500 to 699, see MKI_DB_ATTRIB_*).
-Then, all native data block (types 200 to 299, see MKI_DB_INFO_*).
-Then, all global and local attributes (types 300 to 499, see MKI_DB_ATTRIB_*).
-Finally, a terminating a data block of type 999 (MKI_DB_END).

 

If an explicitly stated sequence is not maintained, this can lead to an application crash, as this sequence is not explicitly tested during file load.

 

Data blocks of all types use the same element sequence that determines the owner of the data block, the data block type and the type and number of data values stored in that data block. The following data block types exist:

 

 

Generic Data Blocks

Generic data blocks are simple data blocks that are used to store values of a single, explicitly stated data type and can be handled without knowledge of their purpose. These data blocks can be used by third-party plug-ins to store all types of data.

 

Element type "Signed Integer value" (__int32)

Element type MKI_DB_TYPE_INT32 (1), see MKI_BLOCK_LONG.

 

Element type "Floating point number" (double)

Element type MKI_DB_TYPE_DOUBLE (2), see MKI_BLOCK_DOUBLE.

 

Element type "Point" (MKI_POINT)

Element type MKI_DB_TYPE_POINT (3), see MKI_BLOCK_POINT.

 

Element type "Color" (MKI_COLORVALUE)

Element type MKI_DB_TYPE_COLOR (4), see MKI_BLOCK_COLOR.

 

Element type "Property Set" (MKI_PROPERTY)

Element type MKI_DB_TYPE_PROPERTY (5), see MKI_BLOCK_PROPERTY.

 

Element type "Extended Property Set" (MKI_XPROPERTY)

Element type MKI_DB_TYPE_XPROPERTY (6), see MKI_BLOCK_XPROPERTY.

 

Element type "Font" (MKI_FONTDEF)

Element type MKI_DB_TYPE_FONTDEF (7), see MKI_BLOCK_FONTDEF.

 

Element type "Text" (MKI_STRW)

Element type MKI_DB_TYPE_TEXT (8), see MKI_BLOCK_TEXT.

 

Element type "Binary Data" (BINARY)

Element type MKI_DB_TYPE_BINARY (9), see MKI_BLOCK_BINARY.

 

 

Standard Data Blocks

All kinds of data blocks have a unique identification stored in the value BlockType. The application uses some standard data blocks for building its entities. These standard data blocks include generic as well native data blocks. Generic data blocks are normally used for general purposes, whereas native data blocks are used for a few number of object types. See MKI_DB_POINT_* and MKI_DB_ALL_*.

 

Data Block Type 0 (General Point)

Data Block Type 1 (Start-Point)

Data Block Type 2 (End-Point)

Data Block Type 3 (Center-Point)

Data Block Type 4 (Radius Definition Point)

Data Block Type 5 (Angle Definition Point)

Data Block Type 6 (Vector Definition Point)

Data Block Type 7 (First Pivot Point)

Data Block Type 8 (Second Pivot Point)

Data Block Type 9 (Arc End-Point)

Data Block Type 10 (Marking)

Data Block Type 50 (Fixed General Point)

Data Block Type 51 (Fixed Start-Point)

Data Block Type 52 (Fixed End-Point)

Data Block Type 53 (Fixed Center-Point)

Data Block Type 54 (Fixed Radius Definition Point)

Data Block Type 55 (Fixed Angle Definition Point)

Data Block Type 56 (Fixed Vector Definition Point)

Data Block Type 57 (Fixed First Pivot Point)

Data Block Type 58 (Fixed Second Pivot Point)

Data Block Type 59 (Fixed Arc End-Point)

Data Block Type 60 (Fixed Marking)

Element type MKI_DB_TYPE_POINT (3), MKI_BLOCK_POINT.

 

Data Block Type 100 (Constant)

Data Block Type 101 (Arc)

Data Block Type 102 (Curve)

Element type MKI_DB_TYPE_DOUBLE (2), see MKI_BLOCK_DOUBLE.

 

Data Block Type 110 (Texts)

Element type MKI_DB_TYPE_TEXT (8), see MKI_BLOCK_TEXT.

 

Data Block Type 999 (End of List)

Element type MKI_DB_TYPE_NATIVE (0), see MKI_BLOCK_BASE.

 

 

Native Data Blocks

Native data blocks are complex data blocks that are used to store native data of the application. Every native data block has its own structure and must be handled separately. See MKI_DB_INFO_*.

 

Third-party plug-ins are not allowed to define their own native data blocks, they have to use Generic Data Blocks instead.

 

Data Block Type 220 (Dimension Line)

Element type MKI_DB_TYPE_NATIVE (0), see MKI_BLOCK_DIMLINE.

 

Data Block Type 225 (Large Dimension)

Element type MKI_DB_TYPE_NATIVE (0), see MKI_BLOCK_DIMLARGE.

 

Data Block Type 230 (Small Dimension)

Element type MKI_DB_TYPE_NATIVE (0), see MKI_BLOCK_DIMSMALL.

 

Data Block Type 235 (Standard Text)

Element type MKI_DB_TYPE_NATIVE (0), see MKI_BLOCK_TEXTSTANDARD.

 

Data Block Type 236 (Frame Text)

Element type MKI_DB_TYPE_NATIVE (0), see MKI_BLOCK_TEXTFRAME.

 

Data Block Type 237 (Reference Text)

Element type MKI_DB_TYPE_NATIVE (0), see MKI_BLOCK_TEXTREFERENCE.

 

Data Block Type 240 (Comment Data)

Element type MKI_DB_TYPE_NATIVE (0), see MKI_BLOCK_COMMENTDATA.

 

Data Block Type 243 (Bitmap Reference)

Element type MKI_DB_TYPE_NATIVE (0), see MKI_BLOCK_BITMAPREF.

 

 

Attribute Data Blocks

Some 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. See MKI_DB_ATTRIB_*.

 

Explicit attributes can be of one of the following type:

-"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, to instances, and to other entity types. Inside a block definition, a local attribute is only a "recommendation", that means such a local attribute indicates that it could be assigned to any instance of this very block. Inside the instance or any other entity, local attributes are valid only for this single entity. This can lead to different values of a local attribute in several instances of the same block.
-"Outline" attributes can only be assigned to outlines within a curve or surface definition and is valid for that whole outline (and all points therein).
-"Point" attribute can only be assigned to individual points inside a curve or surface definition.

 

All kinds of attributes may either be of type "Text", "Number", or "URL". Attributes of types "Text" and "URL" may contain any text of up to MKI_LENGTH_ATTRIBUTE characters in length, whereas attributes of type "Number" must contain a valid numeric value. The total number of attributes of each type (global + local, outline, point) per respective element (entity, outline, and point) is limited to MKI_ATTRIBS_PER_OBJECT per type.

 

Explicit attributes are stored in a special type of native data block with element type MKI_DB_TYPE_NATIVE (0), see MKI_BLOCK_ATTRIBUTE.

 

CAD6interface 2024.2 - Copyright 2024 Malz++Kassner® GmbH