![]() |
CREATT |
| Equivalent PK functions: |
PK_ATTRIB_create_empty PK_ATTRIB_set_axes PK_ATTRIB_set_doubles PK_ATTRIB_set_ints PK_ATTRIB_set_string PK_ATTRIB_set_vectors |
CREATT ( owners, type, nints, ivals, nreals, rvals, nstrng, slens, nchars,
===========================================================================
chars, ifail )
==============
Create an attribute.
Receives:
KI_tag_list_entity *owners --- entity or list of entities to
--- which the attribute is to be
--- attached
KI_tag_attrib_def *type --- type of attribute
<KI_int_nitems> *nints --- number of integer values
int ivals[nints] --- array of integer values
<KI_int_nitems> *nreals --- number of real values
double rvals[nreals] --- array of real values
<KI_int_nitems> *nstrng --- number of strings
<KI_int_nitems> slens[nstrng] --- array of string lengths
<KI_int_nitems> *nchars --- number of characters
KI_chr_string chars[nchars] --- array of data for string fields
Returns:
KI_cod_error *ifail --- error code
Specific errors:
KI_wrong_entity_in_list entity in list cannot own given attribute
KI_system_error no attribute
KI_attr_type_not_defined not a valid attribute definition
KI_attr_mismatch insufficient data for an attribute of this type
KI_buffer_overflow array 'chars' is too small
Description:
An attribute of the given type is created, loaded with the given data
and attached to each entity in the list 'owners'.
The entities in 'owners' must be of types specified as legal owners for
attributes of the given 'type'. The legal owners of a type can be
determined by calling OUATDF.
The values to go into the fields are supplied in three arrays. Each
field is filled in turn by taking the next value from the array of the
appropriate type.
Thus the number of real values supplied, 'nreals', is the number of real
fields plus three times the number of direction, vector and co-ordinate
fields plus six times the number of axis fields.
If there are any character string fields in the attribute their values
are supplied, concatenated, in the array ('chars'). The number of strings
is passed in 'nstrng' and the array 'slens' contains the string lengths.
If 'nchars' is not greater than or equal to the sum of the values in the
array 'slens', KI_buffer_overflow is returned in 'ifail' and no attributes
are created.
If an attribute of the given type is already attached to an entity in
'owners', the old attribute is replaced by one containing the given data,
for attributes of classes RQAC01 to RQAC05. For attributes of class RQAC06
and RQAC07, the list of attribute values is extended to contain the new value.