Scripting > CxEditors > CxPntEditor Object > CxPntEditor Methods

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.
  1 Close button was pressed.

Example

The following example launches a Point Service Definitions dialog box.

Sub

Dim iRet

iRet= PntEditor.Configure

MsgBox iRet

End Sub

Back to top

Connect

The Connect method connects to a PNT.

Syntax

Connect(DomainSiteService As String)

Parameters

Parameter Required Description

DomainSiteService

Yes

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

Example

The following example creates and connects the CxPntEditor object.

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 property sheet 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 property sheet for point "CYGDEMO.UIS.00001388."

Sub

Dim iRet

iRet= PntEditor.Copy("CYGDEMO.UIS.00001388")

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::20190303 to facility CYGDEMO.UIS::20190614.

Sub

Dim iRet, aryEmpty, aryExceptions, strLongIdMask

strLongIdMask = "F(0,20);" + Chr(34) + "_" + Chr(34) + ";U(0,10);"

iRet= PntEditor.CopyPoints("CYGDEMO.PNT", "CYGDEMO", "UIS", "20190303", _"CYGDEMO", "UIS", "20190614", "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 zero when the dialog box is closed.

Example

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

Sub

Dim iKey

iKey = PntEditor.Find("CYGDEMO.UIS.00001388")

PntEditor.CopyPointsUI(iKey)

End Sub

Back to top

Delete

The Delete method launches a Delete Point property sheet 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 delete.  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 property sheet for record "CYGDEMO.UIS.00001388."

Sub

Dim iRet

iRet= PntEditor.Delete("CYGDEMO.UIS.00001388")

MsgBox iRet

End Sub

Back to top

Disconnect

The Disconnect method disconnects from the connected PNT service.

Syntax

Disconnect()

Example

The following example disconnects the PntEditor object.

Sub

PntEditor.Disconnect

End Sub

Back to top

Edit

The Edit method launches a property sheet 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 edit.  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

dialog box closed successfully.

Example

The following example launches a property sheet for record "CYGDEMO.UIS.00001388."

Sub

Dim iRet

iRet= PntEditor.Edit("CYGDEMO.UIS.00001388")

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 edit.  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.00001388."

Sub

Dim iRet

iRet= PntEditor.EditAlarmSettings("CYGDEMO.UIS.00001388")

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 edit.  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.00001388."

Sub

Dim iRet

iRet= PntEditor.EditAlarmSuppression("CYGDEMO.UIS.00001388")

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 edit.  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 a 1 when the dialog box is closed.

Example

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

Sub

Dim iRet

iRet= PntEditor.EditComment("CYGDEMO.UIS.00001388", True)

MsgBox iRet

End Sub

Back to top

EditPointConfig

The EditPointConfig method launches a property sheet 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 edit.  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 1 when the dialog box is closed.

Example

The following example launches a property sheet for record "CYGDEMO.UIS.00001388."

Sub

Dim iRet

iRet= PntEditor.EditPointConfig("CYGDEMO.UIS.00001388")

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 of the record to edit.  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.00001388."

Sub

Dim iRet

iRet= PntEditor.EditQuestionableState("CYGDEMO.UIS.00001388")

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 for which to return a database queue key.  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.00001388."

Sub

Dim iRet

iRet= PntEditor.Find("CYGDEMO.UIS.00001388")

MsgBox iRet

End Sub

Back to top

New

The New method launches a New Point property sheet.

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 a New Point property sheet.

Sub

Dim iRet

iRet= PntEditor.New

MsgBox iRet

End Sub

Back to top

View

The View method launches a property sheet 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 view.  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 property sheet.

Remarks

This method returns one of the following values:

  -1 or 0 An error occurred.
 

1

dialog box closed successfully.

Example

The following example launches a property sheet for record "CYGDEMO.UIS.00001388."

Sub

Dim iRet

iRet= PntEditor.View("CYGDEMO.UIS.00001388", True)

MsgBox iRet

End Sub

Back to top

Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.