Action:
|
Gets the value of a named generic attribute attached to an entity.
|
|
Filename:
|
ga/ga_scm/attr_scm.cxx
|
|
APIs:
|
api_find_named_attribute
|
|
Syntax:
|
(generic:get ent [attrib-name])
|
|
Arg Types:
|
ent
|
entity
|
|
attrib-name
|
string
|
|
Returns:
|
entity | integer | position | real | string | gvector | unspecified
|
|
Errors:
|
Prints out a message if named
attrib-name attribute is not found.
|
|
Description:
|
If the attribute is found on the given
ent entity, it is returned as the type of Scheme object that it is. For example, if the attribute is a real
ATTRIB_GEN_REAL, this returns a real number. If it is a vector, it returns a
gvector, etc.
|
|
Example:
|
; generic:get
|
|
; 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")
|
|
;; ()
|
|
(generic:get block1 "layer")
|
|
; Found
|
|
;; ()
|