ArcObjects Library Reference  (Display)    

IGraphicAttributes Interface

Provides access to members that control the graphic attributes. Note: the IGraphicAttributes interface has been superseded by IGraphicAttributes2. Please consider using the more recent version.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

IGraphicAttributes has methods that define a list of graphic attributes for a number of objects such as GeometricEffects, MarkerPlacements, BasicSymbols including BasicMarkerSymbol, BasicFillSymbol and BasicMarkerSymbol, FillPatterns including SolidColorPattern, GradientPattern and LinePattern.

The following enumerations contain all graphic attributes for the above objects: esriGeometricEffectAttributes, esriGraphicAttribute and esriMarkerPlacementAttributes

When To Use

Use IGraphicAttributes interface for making overrides to the graphic attributes of either Basic Symbols, Geometric Effects, Marker Placements, Fill Patterns or for custom created objects.

 

Members

Description
Read-only property ClassName Class name of the graphic attribute.
Read-only property GraphicAttributeCount Number of graphic attributes.
Read-only property ID ID of graphic attributes.
Read-only property IDByName ID of the graphic attribute, given its name.
Read-only property Name Name of the graphic attribute.
Read-only property Type Type of the graphic attribute.
Read/write property Value Value of the graphic attribute. To erase override, set value to NULL or to original value.

CoClasses that implement IGraphicAttributes

CoClasses and Classes Description
BasicMarkerSymbol Basic marker symbol object.
GeometricEffectAddControlPoints Assigns control point status to line vertices.
GeometricEffectBuffer Constructs a buffer polygon from any type of geometry.
GeometricEffectCut Produces a shorter line based on distances at extremities.
GeometricEffectDash Generates a dashed/dotted line based on a template.
GeometricEffectDonut Inserts a hole into a polygon.
GeometricEffectEnclosingPolygon Constructs enclosing polgon. With multipoint input, constructs a polygon that encloses all points.
GeometricEffectMove Applies a move transformation to a geometry.
GeometricEffectOffset Offsets a line by a specified distance.
GeometricEffectRadial Produces a line from a point, based on direction and length.
GeometricEffectRegularPolygon Creates a regular polygon from a point.
GeometricEffectReverse Reverses the direction of a line.
GeometricEffectRotate Applies a rotate transformation to a geometry.
GeometricEffectScale Applies a scale transformation to a geometry.
GeometricEffectSimplify Simplifies a geometry by eliminating vertices.
GeometricEffectSmooth Smooth a geometry by approximation with beziers.
GeometricEffectTaperedPolygon Creates a taper polygon from a line.
GeometricEffectWave Creates a regular wave from a curve.
GradientPattern A gradient fill pattern object.
LinePattern A line fill pattern object.
LineStroke A line stroke object.
MarkerPlacementAlongLine Places markers along a line.
MarkerPlacementAtExtremities Places a marker on each extremity of a line.
MarkerPlacementDecoration Places markers as line decorations.
MarkerPlacementInsidePolygon Places markers in a polygon.
MarkerPlacementOnLine Places one marker along a line.
MarkerPlacementOnPoint Places a marker on a point.
MarkerPlacementOnVertices Places markers on curve vertices.
MarkerPlacementPolygonCenter Places one marker at the center of a polygon.
MarkerPlacementRandomAlongLine Places markers randomly along a line.
MarkerPlacementRandomInPolygon Places markers randomly within a polygon.
MarkerPlacementVariableAlongLine Places markers with variable size along a line.
SolidColorPattern A solid color pattern object.

Remarks

IGraphicAtributes interface must to be implemented by a custom marker placement, geometric effect or fill pattern.

ClassName defines the name of the object for which the attributes are listed.

ClassName will return the name of the Class object implementing this interface. For all Marker Placements, this property will return the type of the marker placement. For example, for a MarkerPlacementOnPoint, ClassName property will return a string "OnPoint". Similarly, use this interface for retreiving the class names for all types of FillPatterns and GeometricEffects Classes as well.

GraphicAttributeCount is a long and indicates the total numer of attributes present for a particular object. ID is a long and indicates the unique identifier of the attribute. Name is a string that indicates the name of the attribute. Type references to an object implementing IGraphicAttributeType. Use IGraphicAttributeType.Type property to determine the type from the following enumeration esriGraphicAttributeType. Value is a variant that can be used to either set or retrieve value from the attribute.

ID, Name, Type, IDByName and Value are methods that define each individual attribute within the graphic attributes list.

GeometricEffectOffset is a geometric effect used to offset line or  polygon geometries by an offset distance. The ClassName for this object is Offset Curve and it consists of a single attribute with ID equal to 0 and name as Offset. The Attribute type is esriAttributeTypeDouble.

The following VB code explains the usage of this interface.

[Visual Basic 6.0]

      Dim m_pGeomEffect as IGeometricEffect
    Dim m_praphicAtts as IGraphicAttributes
    Dim sClassName as string
    Dim lGraphicAttributeCount aslong

    Set m_pGeomEffect = New GeometricEffectOffset
    Set m_pGraphicAtts = m_pGeomEffect
    sClassName = m_pGraphicAtts.ClassName
    lGraphicAttributeCount = m_pGraphicAtts.GraphicAttributeCount
   
    Dim i As Integer, lID as long, lIDByName as long
    Dim sName As String, lidbyname As Long
    Dim ptype As IGraphicAttributeType, value As Variant
    For i = 0 lGraphicAttributeCount - 1
       
        lID = m_pGraphicAtts.ID(i)
        sName = m_pGraphicAtts.Name(lID)
        lIDByName = m_pGraphicAtts.IDByName(sName)
        set pType = m_pGraphicAtts.Type(lID)
        value = m_pGraphicAtts.value(lID)         'Get value
        value = 2.3
        m_pGraphicAtts.value(lID) = value          'Set new value
 
    Next i