Set Values from Points

CimEdit Scripts provide you with a type called Point.

Point can be used to set and get CIMPLICITY point management information.

For

You can use:

Single (1 element) points

GetValue or a combination of Get and Value to get a single value and set it into a series.

Array points

GetSafeArray or a combination of Get and SafeArray to get a single value and set it into a series.

Example. (GetValue and Get and Value) for Single Points

To set the values of two single points

Option 1

Use the following format to set the values of single points using GetValue:

CimPairData.Set Index, Point.GetValue, Point.GetValue

Option 2

Use the following format to set the values of two points using a combination of Get and Value:

Point.Get

CimPairData.Set Index Point.Value, Point.Value

Example. (GetSafeArray or Get and SafeArray) for Array Points

To set the values of two array points:

Option 1

Use the following format to set the values of two points using GetSafeArray.

CimPairData.Set Index, Point.GetSafeArray, Point.GetSafeArray

Option 2

Use the following format to set the values of two points using a combination of Get and SafeArray.

Point.Get

CimPairData.Set Index, Point.SafeArray, Point.SafeArray

Scripting examples for setting single and array values include:

Example 1. Set the First Location in a Series

Series name: Series 1

Scripting purpose: Set the first location (index 0) in Series 1. The values of two CIMPLICITY points are used.

Procedure:

  1. Open the CimEdit Properties dialog box for the XY Plot control object.

  2. Display the Edit Script tab.

  3. Write the following Basic excerpt within a subroutine.

' Get two point values:

Dim x As New Point

x.Id ="X_POINT"

Dim y As New Point

y.Id ="Y_POINT"

' Set the data in the series object:

cimOleObj.Series("Series 1").Data.Set 0, x.GetValue, y.GetValue

Example 2. Set a Series with the Array Values of Specific Points

Series name: Series 1

Scripting purpose: Set Series 1 with array values of two CIMPLICITY points. The set starts at the first location up to the smaller of either: the size of the array points or the number of available locations in the series.

Procedure:

  1. Open the CimEdit Properties dialog box for the XY Plot control object.

  2. Display the Edit Script tab.

  3. Write the following Basic excerpt within a subroutine.

' Get two point values:

Dim x As New Point

x.Id ="X_ARRAY_POINT"

Dim y As New Point

y.Id ="Y_ARRAY_POINT"

' Get the series object:

Dim series as CimSeries

Set series = cimOleObj.Series("Series 1")

' Set the array data in the series object:

series.Data.Set 0, x.GetSafeArray, y.GetSafeArray

More information

Scripting examples for XY plots.