DiagramObjects

Return to Introduction  Previous page  Next page

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

DiagramID

Long

Read/Write. The ID of the associated diagram (long).

ElementID

Long

Read/Write. The ElementID of the object instance in this diagram.

left

Long

Read/Write. The left position of the element.

right

Long

Read/Write. The right position of the element.

top

Long

Read/Write. The top position of the element.

bottom

Long

Read/Write. The bottom position of the element.

InstanceID

Long

Read/Write. Read only attribute. Holds the link identifier for the current model.

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.

ObjectType

ObjectType

Read only.  Distinguishes objects referenced through a Dispatch interface.

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