Action:
|
Adds a generic attribute to an entity or list of entities.
|
|
Filename:
|
ga/ga_scm/attr_scm.cxx
|
|
APIs:
|
api_add_generic_named_attribute
|
|
Syntax:
|
(generic:add ent-list attrib-name
|
|
|
[option [opt-value*]])
|
|
Arg Types:
|
ent-list
|
entity | (entity ...)
|
|
attrib-name
|
string
|
|
option
|
string | integer | real | boolean |
|
|
|
position | gvector | entity
|
|
opt-value*
|
string
|
|
Returns:
|
unspecified
|
|
Errors:
|
Verifies that the
opt-value is a string. If it is not, an error message for the wrong attribute type is returned.
|
|
Description:
|
When
option is provided, it can have any number of
opt-value items, but it usually has only one value. The
option is then assigned to each entity in the
ent-list.
|
|
Example:
|
; generic:add
|
|
; Create a block.
|
|
(define block1
|
|
|
(solid:block (position 0 0 0)
|
|
|
(position 5 10 15)))
|
|
;; block1
|
|
; Add the following attributes to the block.
|
|
(generic:add block1 "layer")
|
|
;; ()
|