The IDLanROI::ReplaceData procedure method replaces vertices in the region with alternate values. The number of replacement values need not match the number of values being replaced.

*Note: *Setting the DATA property is equivalent to calling ReplaceData when START=0 and FINISH=*nVerts*-1 (where *nVerts* is the number of vertices in the original ROI).

## Syntax

*Obj->*[IDLanROI::]ReplaceData, *X*[, *Y*[, *Z*]] [, START=*index*] [, FINISH=*index*] [, XRANGE=*variable*] [, YRANGE=*variable*] [, ZRANGE=*variable*]

## Arguments

### X

A vector providing the X components of the new replacement vertices. If the Y and Z arguments are not specified, X must be a two-dimensional array with the leading dimensions either 2 or 3 ([2, *] or [3, *]), in which case, X[0, *] represents the X values, X[1, *] represents the Y values, and X[2, *] represents the Z values. If the DOUBLE property is non-zero, the data is converted to double precision and is appended to the existing double precision data. Otherwise it is converted to single precision floating point and appended to the existing single precision data.

### Y

A vector providing the Y components of the new replacement vertices. If the DOUBLE property is non-zero, the data is converted to double precision and is appended to the existing double precision data. Otherwise it is converted to single precision floating point and appended to the existing single precision data.

### Z

A vector providing the Z components of the new replacement vertices. If the DOUBLE property is non-zero, the data is converted to double precision and is appended to the existing double precision data. Otherwise it is converted to single precision floating point and appended to the existing single precision data.

## Keywords

### FINISH

Set this keyword to the index of the region’s current subregion vertex list where the replacement ends. If the START keyword value is ≥ 0, the default FINISH is given by

FINISH = ((START + N_NEW – 1) MOD N_OLD)

where N_NEW is the number of replacement vertices provided via the [*X*, *Y*, *Z*] arguments and N_OLD is the number of vertices (prior to replacement) in the current subregion.

If the START keyword is not set or is negative, the default FINISH is given by

FINISH = N_OLD – 1

FINISH may be less than START in which case the vertices, including and following START and the vertices preceding and including FINISH, are replaced with the new values.

### START

Set this keyword to an index of the region’s current subregion vertex list where the replacement begins. If the FINISH keyword value is ≥ 0, the default START is given by

START = ((FINISH – N_NEW + 1) MOD N_OLD)

where N_NEW is the number of replacement vertices provided via the [*X*, *Y*, *Z*] arguments and N_OLD is the number of vertices (prior to replacement) in the current subregion.

If the FINISH keyword is not set (or negative), the default START is clamped to 0 and is given by

N_OLD – N_NEW

### XRANGE

Set this keyword to a named variable that upon return contains a two-element vector, [*xmin*, *xmax*], representing the *X* range of the modification to the region. The reported range accounts for the replaced vertices, the vertex just before the replacement (if any), the vertex just after the replacement (if any), and the new replacement vertices. This data is returned in double-precision floating-point.

### YRANGE

Set this keyword to a named variable that upon return contains a two-element vector, [*ymin*, *ymax*], representing the *Y* range of the modification to the region. The reported range accounts for the replaced vertices, the vertex just before the replacement (if any), the vertex just after the replacement (if any), and the new replacement vertices. This data is returned in double-precision floating-point.

### ZRANGE

Set this keyword to a named variable that upon return contains a two-element vector, [*zmin*, *zmax*], representing the *Z* range of the modification to the region. The reported range accounts for the replaced vertices, the vertex just before the replacement (if any), the vertex just after the replacement (if any), and the new replacement vertices. This data is returned in double-precision floating-point.

## Version History

5.3 |
Introduced |