CPolygon:CopyPts
The CopyPts method copies the points from an existing CPolygon into the current one. The other properties of the current CPolygon are left intact, with the exception of the point count and value limits. All points in the current CPolygon are deleted before copying starts.
bSuccess = CPolygon:CopyPts( arrayX, arrayY ) bSuccess = CPolygon:CopyPts( CPolygon2 ) where |
arrayX, arrayY are lua tables containing the x data and y points dayta, respectively.
CPolygon2 is an existing CPolygon that is copies into the current CPolygon object. In place of CPolygons, use the name of the actual object to be copied.
bSuccess is the returned success code. On success it is true, otherwise false.
The following script creates a CPolygon A. Later in the script, after the CPolygon has been configured and used, the script copies 2 data arrays,x, and y, into A to replace its prior point collection:
|
-- create CPolygon A |
-- do something with CPolygon A |
|
|
|
|
-- create some x and y data |
|
-- replace the points of A with x and y |
|
-- result: N = 4 |