DiagramObject Class

The DiagramObject Class stores presentation information that indicates what is displayed in a diagram and how it is shown.

Associated table in .EAP file: t_diagramobjects

DiagramObject Attributes

Attribute

Type

Notes

See Also

Bottom

Long

Read/Write; the bottom position of the element

 

DiagramID

Long

Read/Write; the ID of the associated diagram (long)

 

ElementID

Long

Read/Write; the ElementID of the object instance in this diagram

 

InstanceID

Long

Read/Write; read only attribute that holds the connector identifier for the current model

 

Left

Long

Read/Write; the left position of the element

 

ObjectType

ObjectType

Read only; distinguishes objects referenced through a Dispatch interface

 

Right

Long

Read/Write; the right position of the element

 

Sequence

Long

Read/Write; the sequence position when loading into diagram (affects Z order)

The Z-order is one-based and the lowest value is in the foreground

 

Style

Variant

Write only (reading this value gives undefined results); style information for this object

Setting the Style

Top

Long

Read/Write; the top position of the element

 

DiagramObject Methods

Method

Type

Notes

GetLastError ()

String

Returns a string value describing the most recent error that occurred in relation to this object

This function is rarely used as an exception is thrown when an error occurs

Update ()

Boolean

Update the current DiagramObject after modification or appending a new item

If false is returned, check the GetLastError function for more information

Topics:

Topic

Detail

See also

Setting The Style

The Style attribute is used for setting the appearance of a DiagramObject; it is set with a string value in the format:

BCol=n;BFol=n;LCol=n;LWth=n;

where:

  • BCol = Background Color
  • BFol = Font Color
  • LCol = Line Color
  • LWth = Line Width

 

The color value is a decimal representation of the hex RGB value, where Red=FF, Green=FF00 and Blue=FF0000; for example:

DiagObj.Style = "BCol=35723;BFol=9342520;LCol=9342520;LWth=1;"

 

The following code snippet shows how you might change the style settings for all of the objects in the current diagram, in this case changing everything to red:

For Each aDiagObj In aDiag.DiagramObjects

           aDiagObj.Style = "BCol=255;BFol=9342520;LCol=9342520;LWth=1;"

           aDiagObj.Update

           aRepos.ReloadDiagram aDiagObj.DiagramID

Next