Home > All Other Interfaces > IAttributes > CreateAttribute

CreateAttribute

Creates a new layer attribute.

 

JavaScript

 

CreateAttribute(

      sAttributeName,

      attrType,

      nStringSize)

 

C#

 

void CreateAttribute(

      string sAttributeName,

      AttributeTypeCode attrType,

      int nStringSize)

 

C++

 

HRESULT CreateAttribute(

      BSTR sAttributeName,

      AttributeTypeCode attrType,

      long nStringSize)

Parameters

sAttributeName

A string that holds the attribute’s name.

attrType

An enum that determines the attribute type. The following are the possible values:

·         AT_UNKNOWN = -1

·         AT_TEXT = 0

·         AT_INTEGER = 1

·         AT_DOUBLE = 2

nStringSize

The string size, if creating string attribute. Otherwise, pass 0 (zero).

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.