Skip to content

adddetailattrib

If you don’t know the class of attribute until runtime, use addattrib.

int  adddetailattrib(int geohandle, string name, <type>defvalue)

int  adddetailattrib(int geohandle, string name, <type>defvalue[])

Adds a detail attribute to the given geometry.

int  adddetailattrib(int geohandle, string name, <type>defvalue, string typeinfo)

int  adddetailattrib(int geohandle, string name, <type>defvalue[], string typeinfo)

Adds a detail attribute with the given transformation info. See attribtypeinfo for more details.

geohandle

A handle to the geometry to write to. Currently the only valid value is 0 or geoself, which means the current geometry in a node. (This argument may be used in the future to allow writing to other geometries.)

name

The name of the attribute to create.

defvalue

The default value for the attribute and determines the type of attribute to create. String and array attributes cannot have defaults, so only the type is used in those cases.

Returns

geohandle on success, or -1 on failure.

  • If an attribute of the same name already exists, the function will try to convert it to the new type.