DiagramObjects

public Class

The DiagramObjects collection holds a list of element IDs and presentation information that indicates what is displayed in a diagram and how it is shown.

Associated table in .EAP file: t_diagramobjects

DiagramObjects Attributes

Attribute

Type

Notes

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. 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.

See Setting the Style below for more information.

Top

Long

Read/Write. The top position of the element.

DiagramObjects 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 object after modification or appending a new item.

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

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