gis:layer-add-attribute
(gis:layer-add-attribute layerId
attDef)
This function adds a new 'GIS Attribute' as
specified by attDef definition list to the 'GIS Layer' object specified
by layerId.
Arguments
|
layerId (integer) 'handle' identifier of the 'GIS
Layer' to add the 'GIS Attribute' to
attDef (list
AttributeName AttributeType AttributeValue) the
AttributeDefinition list :
AttributeName (string) the
name of the Attribute
AttributeType (integer) the
type of the Attribute (see the Type Constants enumeration "Civil GIS Attribute Type")
AttributeValue (string or integer
or double) the initial value to be assigned : string or
integer or double
|
Return
|
T on success, or NIL
|
Example
|
(vl-load-gis)
T
(setq layers (gis:get-layers))
("shp_3857_point_2d_utf8")
(setq name (car layers))
"shp_3857_point_2d_utf8"
(setq layerId (gis:get-layer name))
1736947670764
(setq attributes (gis:layer-get-attributes
layerId)) ("id" "name" "int_number" "dec_number"
"date")
(gis:layer-has-attribute layerId "NewId")
NIL
(gis:layer-add-attribute layerId (list "NewId"
3 "---empty---")) T
(setq attributes (gis:layer-get-attributes
layerId)) ("id" "name" "int_number" "dec_number" "date"
"NewId")
(gis:layer-has-attribute layerId "NewId")
T
|
Remarks
|
for the for the 'GIS
Attribute Type' please see the Type Constants enumeration "Civil GIS Attribute Type";
a 'GIS Feature Attribute' represents a
"Column" in the GIS Database table; each 'GIS Feature' (built-up
from dwg entities) is a row in such table;
the 'GIS Feature Attribute' name string is
always handled as case-insensitive !
|