Organization of Extended Data

Extended data consists of one or more 1001 groups, each of which begins with a unique application name. Application names are string values. The extended data groups returned by acdbEntGetX() follow the definition data in the order in which they are saved in the database.

Within each application's group, the contents, meaning, and organization of the data are defined by the application; AutoCAD maintains the information but doesn't use it. Group codes for extended data are in the range 1000–1071, as follows:

String

1000. Strings in extended data can be up to 255 bytes long (with the 256th byte reserved for the null character).

Application name

1001 (also a string value). Application names can be up to 31 bytes long (the 32nd byte is reserved for the null character) and must adhere to the rules for symbol table names (such as layer names). An application name can contain letters, digits, and the special characters $ (dollar sign), - (hyphen), and _ (underscore). It cannot contain spaces. Letters in the name are converted to uppercase.

A group of extended data cannot consist of an application name with no other data.

To delete extended data

  1. Call acdbEntGet() to retrieve the entity.
  2. Add to the end of the list returned by acdbEntGet() a resbuf with a restype of -3.
  3. Add to the end of the list another resbuf with a restype of 1001 and a resval.rstring set to <appname>.

If you attempt to add a 1001 group but no other extended data to an existing entity, the attempt is ignored. If you attempt to make an entity whose only extended data group is a single 1001 group, the attempt fails.

Layer name

1003. Name of a layer associated with the extended data.

Database handle

1005. Handles of entities in the drawing database. Under certain conditions, AutoCAD translates these.

3D point

1010. Three real values, contained in a point.

Real

1040. A real value.

Integer

1070. A 16-bit integer (signed or unsigned).

Long

1071. A 32-bit signed (long) integer. If the value that appears in a 1071 group is a short integer or a real value, it is converted to a long integer; if it is invalid (for example, a string), it is converted to a long zero (0L).

Control string

1002. An extended data control string can be either “{” or “}”. These braces enable the application to organize its data by subdividing it into lists. The left brace begins a list, and the right brace terminates the most recent list. (Lists can be nested.) When it reads the extended data, AutoCAD checks to ensure that braces are balanced correctly.

Binary data

1004. Binary data is organized into variable-length chunks, which can be handled in ObjectARX with the ads_binary structure. The maximum length of each chunk is 127 bytes.

World space position

1011. Unlike a simple 3D point, the world space coordinates are moved, scaled, rotated, and mirrored along with the parent entity to which the extended data belongs. The world space position is also stretched when the STRETCH command is applied to the parent entity and this point lies within the selection window.

World space displacement

1012. A 3D point that is scaled, rotated, or mirrored along with the parent, but not stretched or moved.

World direction

1013. Also a 3D point that is rotated, or mirrored along with the parent, but not scaled, stretched, or moved. The world direction is a normalized displacement that always has a unit length.

Distance

1041. A real value that is scaled along with the parent entity.

Scale factor

1042. Also a real value that is scaled along with the parent.

Note:

If a 1001 group appears within a list, it is treated as a string and does not begin a new application group.