Provides access to members that control the attribute formatted.
An attribute formatted lets you spawn a new attribute by formatting existing attributes and/or formatting string.
| Description | ||
|---|---|---|
![]() |
Attributes | List of the attributes to be formatted. |
![]() |
Format | C-language compliant format of the resulting attribute. |
![]() |
Name | Name of the attribute formatted. |
| CoClasses and Classes | Description |
|---|---|
| NgAttributeFormatted | Attribute formatted object. |
This code sample shows how you can create a new INgAttributeFormatted interface for an element type that will be used afterwards by a textual property to display a label for each element of this type. The label displayed for each element will be a formatted string that will concatenate the "Identifier: " string with the element OBJECTID field value. As the final label must use the OBJECTID database field returned by the query set for the element type as a formatted parameter, you will begin to create the attribute field related to this OBJECTID database field.
Private WithEvents m_NgProject As esriSchematic.NgProject
Private m_INgProject As esriSchematic.INgProject
...
Dim pEltType As INgElementType
Dim pObjectType As INgObjectType
Dim pAttribField As INgAttributeField
Dim pFieldName As INgName
Dim pFieldNamesList As INgNames
Dim pAttribFormatted As INgAttributeFormatted
Dim pAttributesList As INgAttributes
...
Set pFieldName = New NgName
Set pFieldNamesList = New NgNames
Set pAttributesList = New NgAttributes
Set pObjectType = pEltType
' Creating the OBJECTID_Field field attribute realted to the OBJECTID database field
pObjectType.CreateAttribute "OBJECTID_Field", esriNgFieldAttribute
Set pAttribField = pObjectType.GetAttribute("OBJECTID_Field")
pFieldName.Name = "OBJECTID"
pFieldNamesList.Add pFieldName
pAttribField.FieldNames = pFieldNamesList
' Creating the formatted GraphicLabel attribute
pObjectType.CreateAttribute "GraphicLabel", esriNgFormattedAttribute
Set pAttribFormatted = pObjectType.GetAttribute("GraphicLabel")
pAttribFormatted.Format = "Identifier: %s"
pAttributesList.Add pAttribField
pAttribFormatted.Attributes = pAttributesList
...