Association Methods

The Association object contains the following methods:

GetTag

The GetTag method returns the tag of an associated item.

For a requested facility tag, the format is:

For a requested point tag, the possible formats are:

Syntax

GetTag() As String

Return Values

This method returns the requested tag of an associated item. If an association is not set, an error is returned.

Back to top

GetType

The GetType method returns the type of an associated item.

Syntax

GetType() As EAssociationType

Return Values

This method returns the requested type of an associated item. If an association is not set, an error is returned.

Back to top

SetAssociation

The SetAssociation method sets an association for a note by using a specified tag and type.

Note: You may refer to facilities and points that are not on services associated with a given Note Service. However, such items have limited functionality. For example, they are included in a note record, but they do not generate note labels on a Trend Tool. See also Associating Facilities and Points.

Valid type values for EAssociationType are as follows:

Syntax

SetAssociation(Tag As String, Type As EAssociationType)

Parameters

Parameter Description

Tag

Specifies the tag of an associated item in any valid CygNet facility or point tag format.

Type

Specifies the type of an associated item. The tag and type must be either for a facility or a point.

Return Values

This method has no return value.

Example

The following example illustrates the SetAssociation method in an applied situation. The script in this example connects to Note Service, gets a specific note, creates a vector of Association objects, and finally sets the associations for the specified note.

Copy
SetAssociation
Dim CxNote
Set CxNote = CreateObject("CxNote.NoteClient")
CxNote.Connect "MYSITE.NOTE"
Dim iNote
Set iNote = CxNote.GetNote("MYSITE.NOTE~698")
Dim testAssoc(2)
Set testAssoc(0) = CreateObject("CxNote.Association")
Set testAssoc(1) = CreateObject("CxNote.Association")
Set testAssoc(2) = CreateObject("CxNote.Association")
testAssoc(0).SetAssociation "MYSITE.UIS::NOTESTEST", 0
testAssoc(1).SetAssociation "MYSITE.UIS::NOTESTEST.NOTE_0", 1
testAssoc(2).SetAssociation "MYSITE.UIS.0000135", 1
iNote.Associations = testAssoc
CxNote.UpdateNote iNote

Back to top