ade_odmodifyfield

AutoCAD Map 3D AutoLISP

Up a level
ade_odmodifyfield
 
 

Modifies field properties in a table.

(ade_odmodifyfield tableName fieldList)

Returns T or nil.

tableName Table name (string) can be up to 25 characters long. Must be unique, contain no spaces, and start with an alphanumeric character
fieldList Fields to modify. A sequence of field definitions. See Field Definitions below.

The ade_odmodifyfield function affects all active drawings in the drawing set. There should not be any queried objects for this operation.

Note  This function will not operate unless your end user has superuser privileges.

Field Definitions

The field definitions are introduced by the "columns" string. Each field definition is a list of a-lists, and each a-list consists of a field property and a value, as follows:

Field PropertyField Value
colname Field name (string) can be up to 31 characters long. Must be unique, contain no spaces, and start with an alphanumeric character
coldesc Field description (string)
coltype Field data type
defaultval Default field value

In the fieldlist argument, specify the fields to modify and their new field definitions. The function acts on these fields only and has no effect on any others. For each field you specify, the function replaces the existing field definition with the new field definition in the table and in each of its records. In each record, the modified fields are assigned default values that correspond to their new field definitions. In other words, the function replaces field definitions in each set of object data defined by the table and attached to an object.

The fieldlist argument has the same format as the fieldlist argument in ade_odaddfield. The entry for this function has source code examples.

If a new field definition changes the field type, field values in existing records are converted to the new type if possible. This conversion may alter the values. For example, if you change the field type from real to integer, existing field values are converted by truncating their decimal parts.