CPolygon:Copy
The Copy method copies all the points and properties of an existing CPolygon into the current one. This effectivly makes the current polygon a cuplicate of the other polygon. All points in the current CPolygon are deleted before copying starts.
bSuccess = CPolygon:Copy( CPolygon2 ) where |
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.
To make the current CPolygon B adopt all the properties and points of the an existing CPolygon A, use the Copy method. This is useful when the polygon B already exists but needs to be replaced with other data. For example,
|
-- CPolygon A is copied into B |
To create a new CPolygon B that is a copy of an existing CPolygon A, use the copy constructor, as in
|
-- CPolygon A already exists |
Choose the syntax that fits best with your script.
Assume that a CPolygon A already exists. The following script creates a new CPolygonA2 from 2 data arrays, then replaces the old CPolygon A with the new CPolygon A2:
|
-- create CPolygon A |
-- do something with CPolygon A |
|
|
|
|
-- create some x and y data |
|
-- create CPolygon A2 from x and y |
|
|
|
-- copy the new A2 into the old A |
|
-- result: N = 4,4 |