CxPntEditor Methods

The CxPntEditor object contains the following methods:

Configure

The Configure method launches a Point Service Definitions dialog box, which is used to configure attribute definitions and Config Bit states. See Setting Default Point Configuration for more information.

Syntax

Configure() As Integer

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  2 The Close or Save button was pressed.

Example

The following example launches the Service Definitions or Configuration dialog box.

Copy
Configure
Sub

    Dim iRet
    iRet = <SvcEditor>.Configure
    MsgBox iRet

End Sub

Back to top

Connect

The Connect method connects the object to a service.

Syntax

Connect(DomainSiteService As String)

Parameters

Parameter Required Description

DomainSiteService

Yes

The [Domain]Site.Service to which to connect. The domain is optional. The service must be a valid one.

Remarks

Returns 0 if successful and a non-zero value if the connection failed.

Example

The following example connects the Client object to the CYGDEMO.<SVC> on domain 5410:

Copy
Connect
Sub

    Dim PntEditor
    Set PntEditor = CreateObject("CxEditors.CxPntEditor")
    PntEditor.Connect("[5410]CYGDEMO.PNT")

End Sub

Back to top

Copy

The Copy method launches a New Point dialog box initialized with the information in the specified record.

Syntax

Copy(TagOrQueueKey As String) As Integer

Parameters

Parameter Required Description

TagOrQueueKey

Yes

The point tag or database queue key of the record to copy. The point tag can be in one of the following forms:

  • SITE.SERVICE.POINTID
  • SITE.SERVICE:POINTIDLONG
  • SITE.SERVICE.POINTID:POINTIDLONG
  • SITE.SERVICE::FACILITY.UDC

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 OK button was pressed.
  2 Cancel button was pressed.

Example

The following example launches a New Point dialog box for point "CYGDEMO.UIS.0000012345".

Copy
Copy
Sub

    Dim iRet
    iRet= PntEditor.Copy("CYGDEMO.UIS.0000012345")
    MsgBox iRet

End Sub

Back to top

CopyPoints

The CopyPoints method copies a set of points to a new facility ID.

Syntax

CopyPoints(destSiteService As String, siteSelected As String, serviceSelected As String, facilitySelected As String, newSite As String, newService As String, newFacility As String, shortIdMask As String, longIdMask As String, vbTestOnly As Variant, SelectedPoints As Variant, ExceptionArray As Variant) As Integer

Parameters

Parameter Required Description

destSiteService

Yes

The PNT Site.Service to which to copy the resolved set of points

siteSelected

Yes

The associated site of the set of points to copy

serviceSelected

Yes

The associated service of the set of points to copy

facilitySelected

Yes

The facility ID of the set of points to copy

newSite

Yes

The new associated site of the copied points

newService

Yes

The new associated service of the copied points

newFacility

Yes

The new facility ID of the copied points

shortIdMask

Yes

A mask specifying the short point IDs of the new points 

The mask may consist of the following semicolon-delimited specifiers:

  • " " — Text characters (for example, "MYTEXT";)
  • A — Auto-create ID
  • P(X,Y) — Existing short point ID, where X is the zero-based starting position and Y is the total number of characters to copy from the original ID (for example, P(4,0); to copy the first 4 characters from the existing ID)
  • L(X,Y) — Existing long point ID, where X is the zero-based starting position and Y is the total number of characters to copy from the original ID (for example, P(4,0); to copy the first 4 characters from the existing ID)
  • F(X,Y) — Destination facility ID, where X is the zero-based starting position and Y is the total number of characters to copy from the destination facility ID (for example, P(4,0); to copy the first 4 characters from the destination facility ID)
  • U(X,Y) — Uniform Data Code, where X is the zero-based starting position and Y is the total number of characters to copy from the UDC (for example, P(4,0); to copy the first 4 characters from the UDC)
  • S(X,Y) — Destination site, where X is the zero-based starting position and Y is the total number of characters to copy from the destination site (for example, P(4,0); to copy the first 4 characters from the destination site)
  • V(X,Y) — Destination service, where X is the zero-based starting position and Y is the total number of characters to copy from the destination service (for example, P(4,0); to copy the first 4 characters from the destination service)

Example

A valid short point ID mask is:

"NEW";P(4,4);

This mask creates a new Point ID by appending the word "NEW" to the beginning of the last four digits of the existing short point ID.  That means a point copied from a point with Point ID 00001383 results in a new Point ID value of NEW1383.

longIdMask

Yes

A mask specifying the long point IDs of the new points.  The mask may consist of the same specifiers listed in the above description of the shortIdMask parameter.

vbTestOnly

Yes

Set this parameter to True to test for errors without actually copying points.

SelectedPoints

Yes

This parameter is not used by this method.

ExceptionArray

Yes

The array of errors returned by this method.

Remarks

This method returns a -1 if destSiteService is invalid, or if the user does not have PNT ADD access for this service.  Otherwise, it returns a 0.

Example

The following example launches copies points for facility CYGDEMO.UIS::20240303 to facility CYGDEMO.UIS::20240614.

Copy
CopyPoints
Sub

    Dim iRet, aryEmpty, aryExceptions, strLongIdMask
    strLongIdMask = "F(0,20);" + Chr(34) + "_" + Chr(34) + ";U(0,10);"
    iRet= PntEditor.CopyPoints("CYGDEMO.PNT", "CYGDEMO", "UIS", "20240303", _"CYGDEMO", "UIS", "20240614", "A;", strLongIdMask, False, aryEmpty, aryExceptions)
    Dim i, j, strMsg, bErr
    bErr = False
    For i = 0 To UBound(aryExceptions, 1)
        bErr = True
        strMsg = strMsg + aryExceptions(i, 0) + ": "
        For j = 1 To UBound(aryExceptions, 2)
        strMsg = strMsg + aryExceptions(i, j) + vbCr
        Next
        strMsg = strMsg + vbCr
    Next
     
    If Not(bErr) And Not(iRet) Then
        strMsg = "Point(s) copied successfully"
    ElseIf Not(bErr) And iRet = -1 Then
        strMsg = "Error with destination Site.Service: "
        strMsg = strMsg + "Make sure you have PNT ADD access, "
        strMsg = strMsg + "and that the Site.Service is a valid PNT service".
    End If
    MsgBox strMsg

End Sub

Back to top

CopyPointsUI

The CopyPointsUI method launches a Facility Point Copy dialog box.

Syntax

CopyPointsUI(TagOrQueueKey As String) As Integer

Parameters

Parameter Required Description

TagOrQueueKey

Yes

The point tag or database queue key of the record to copy. The point tag can be in one of the following forms:

  • SITE.SERVICE.POINTID
  • SITE.SERVICE:POINTIDLONG
  • SITE.SERVICE.POINTID:POINTIDLONG
  • SITE.SERVICE::FACILITY.UDC

Remarks

This method returns a 0 when the dialog box is closed.

Example

The following example launches a Facility Point Copy dialog box for point "CYGDEMO.UIS.0000012345".

Copy
CopyPointsUI
Sub

    Dim iKey
    iKey = PntEditor.Find("CYGDEMO.UIS.0000012345")
    PntEditor.CopyPointsUI(iKey)

End Sub

Back to top

Delete

The Delete method launches a Delete Point dialog box initialized with the information in the specified record.

Syntax

Delete(TagOrQueueKey As String) As Integer

Parameters

Parameter Required Description

TagOrQueueKey

Yes

The point tag or database queue key of the record to copy. The point tag can be in one of the following forms:

  • SITE.SERVICE.POINTID
  • SITE.SERVICE:POINTIDLONG
  • SITE.SERVICE.POINTID:POINTIDLONG
  • SITE.SERVICE::FACILITY.UDC

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 OK button was pressed.
  2 Cancel button was pressed.

Example

The following example launches a Delete Point dialog box for record "CYGDEMO.UIS.0000012345".

Copy
Delete
Sub

    Dim iRet
    iRet= PntEditor.Delete("CYGDEMO.UIS.0000012345")
    MsgBox iRet

End Sub

Back to top

Disconnect

The Disconnect method disconnects from the connected service.

Syntax

Disconnect() As Integer

Remarks

The Disconnect method returns 0 if successful and a non-zero value if the disconnect failed.

Example

The following example disconnects the Client object from the connected service, and pops a message box if it is unsuccessful:

Copy
Disconnect
Sub Svc.Disconnect()
 
    <SvcClient>.Disconnect()
    MsgBox "Service has disconnected."
    
    If <SvcClient>.Disconnect <> 0 
    Then
        MsgBox "Failed to disconnect."
    End If

End Sub

Back to top

Edit

The Edit method launches a dialog box for the specified record.

Syntax

Edit(TagOrQueueKey As String) As Integer

Parameters

Parameter Required Description

TagOrQueueKey

Yes

The point tag or database queue key of the record to copy. The point tag can be in one of the following forms:

  • SITE.SERVICE.POINTID
  • SITE.SERVICE:POINTIDLONG
  • SITE.SERVICE.POINTID:POINTIDLONG
  • SITE.SERVICE::FACILITY.UDC

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 The dialog box closed successfully.

Example

The following example launches a dialog box for record "CYGDEMO.UIS.0000012345".

Copy
Edit
Sub

    Dim iRet
    iRet= PntEditor.Edit("CYGDEMO.UIS.0000012345")
    MsgBox iRet


End Sub

Back to top

EditAlarmSettings

The EditAlarmSettings method launches an Alarm Settings dialog box for the specified record.

Syntax

EditAlarmSettings(TagOrQueueKey As String) As Integer

Parameters

Parameter Required Description

TagOrQueueKey

Yes

The point tag or database queue key of the record to copy. The point tag can be in one of the following forms:

  • SITE.SERVICE.POINTID
  • SITE.SERVICE:POINTIDLONG
  • SITE.SERVICE.POINTID:POINTIDLONG
  • SITE.SERVICE::FACILITY.UDC

Remarks

This method returns a 0 when the dialog box is closed.

Example

The following example launches an Alarm Settings dialog box for record "CYGDEMO.UIS.0000012345".

Copy
EditAlarmSettings
Sub

    Dim iRet
    iRet= PntEditor.EditAlarmSettings("CYGDEMO.UIS.0000012345")
    MsgBox iRet

End Sub

Back to top

EditAlarmSuppression

The EditAlarmSuppression method launches an Alarm Suppression Settings dialog box for the specified record.

Syntax

EditAlarmSuppression(TagOrQueueKey As String) As Integer

Parameters

Parameter Required Description

TagOrQueueKey

Yes

The point tag or database queue key of the record to copy. The point tag can be in one of the following forms:

  • SITE.SERVICE.POINTID
  • SITE.SERVICE:POINTIDLONG
  • SITE.SERVICE.POINTID:POINTIDLONG
  • SITE.SERVICE::FACILITY.UDC

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 OK button was pressed.
  2 Cancel button was pressed.

Example

The following example launches an Alarm Suppression Settings dialog box for record "CYGDEMO.UIS.0000012345".

Copy
EditAlarmSuppression
Sub

    Dim iRet
    iRet= PntEditor.EditAlarmSuppression("CYGDEMO.UIS.0000012345")
    MsgBox iRet

End Sub

Back to top

EditComment

The EditComment method launches a Point Comment dialog box for the specified record.

Syntax

EditComment(TagOrQueueKey As String, Edit As Boolean) As Integer

Parameters

Parameter Required Description

TagOrQueueKey

Yes

The point tag or database queue key of the record to copy. The point tag can be in one of the following forms:

  • SITE.SERVICE.POINTID
  • SITE.SERVICE:POINTIDLONG
  • SITE.SERVICE.POINTID:POINTIDLONG
  • SITE.SERVICE::FACILITY.UDC

Edit

No

Set this parameter to True in order to allow editing of the point comment.  If this parameter is not specified, it will default to False.

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 The dialog box closed successfully.

Example

The following example launches a Point Comment dialog box for record "CYGDEMO.UIS.0000012345".

Copy
EditComment
Sub

    Dim iRet
    iRet= PntEditor.EditComment("CYGDEMO.UIS.0000012345", True)
    MsgBox iRet

End Sub

Back to top

EditPointConfig

The EditPointConfig method launches a dialog box for the specified record.

Syntax

EditPointConfig(TagOrQueueKey As String) As Integer

Parameters

Parameter Required Description

TagOrQueueKey

Yes

The point tag or database queue key of the record to copy. The point tag can be in one of the following forms:

  • SITE.SERVICE.POINTID
  • SITE.SERVICE:POINTIDLONG
  • SITE.SERVICE.POINTID:POINTIDLONG
  • SITE.SERVICE::FACILITY.UDC

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 The dialog box closed successfully.

Example

The following example launches a dialog box for record "CYGDEMO.UIS.0000012345".

Copy
EditPointConfig
Sub

    Dim iRet
    iRet= PntEditor.EditPointConfig("CYGDEMO.UIS.0000012345")
    MsgBox iRet


End Sub

Back to top

EditQuestionableState

The EditQuestionableState method launches an Edit Questionable State dialog box for the specified record.

Syntax

EditQuestionableState(Tag As String) As Integer

Parameters

Parameter Required Description

TagOrQueueKey

Yes

The point tag or database queue key of the record to copy. The point tag can be in one of the following forms:

  • SITE.SERVICE.POINTID
  • SITE.SERVICE:POINTIDLONG
  • SITE.SERVICE.POINTID:POINTIDLONG
  • SITE.SERVICE::FACILITY.UDC

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 OK button was pressed.
  2 Cancel button was pressed.

Example

The following example launches an Edit Questionable State dialog box for record "CYGDEMO.UIS.0000012345".

Copy
EditQuestionableState
Sub

    Dim iRet
    iRet= PntEditor.EditQuestionableState("CYGDEMO.UIS.0000012345")
    MsgBox iRet

End Sub

Back to top

Find

The Find method returns the database queue key for a specified point tag.

Syntax

Find(Tag As String) As Integer

Parameters

Parameter Required Description

Tag

Yes

The point tag or database queue key of the record to copy. The point tag can be in one of the following forms:

  • SITE.SERVICE.POINTID
  • SITE.SERVICE:POINTIDLONG
  • SITE.SERVICE.POINTID:POINTIDLONG
  • SITE.SERVICE::FACILITY.UDC

Example

The following example displays the database queue key for point "CYGDEMO.UIS.0000012345".

Copy
Find
Sub

    Dim iRet
    iRet= PntEditor.Find("CYGDEMO.UIS.0000012345")
    MsgBox iRet

End Sub

Back to top

New

The New method launches a New Point dialog box.

Syntax

New() As Integer

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 OK button was pressed.
  2 Cancel button was pressed.

Example

The following example launches the specified editor dialog box:

Copy
New
Sub

    Dim iRet
    iRet = <SvcEditor>.New
 
    MsgBox iRet
    
End Sub

Back to top

View

The View method launches a dialog box for the specified record.

Syntax

View(Key As String, EditEnabled As Boolean) As Integer

Parameters

Parameter Required Description

Key

Yes

The point tag or database queue key of the record to copy. The point tag can be in one of the following forms:

  • SITE.SERVICE.POINTID
  • SITE.SERVICE:POINTIDLONG
  • SITE.SERVICE.POINTID:POINTIDLONG
  • SITE.SERVICE::FACILITY.UDC

EditEnabled

Yes

Set to true to enable editing of the dialog box.

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
  1 The dialog box closed successfully.

Example

The following example launches a dialog box for record "CYGDEMO.UIS.0000012345".

Copy
View
Sub
    Dim pntEditor
    Set pntEditor = CreateObject("CxEditors.CxPntEditor")
    pntEditor.Connect "CYGDEMO.PNT"
    pntEditor.View "CYGDEMO.HSS:AA_ACC00", True
End Sub

Back to top