high low points

Here’s a script for finding the first and last point of an array, and then placing two points offset from them to allow you to locate a range or a box or anything outside of that point array. Note the first four “ints” are the offset amounts. If you want to use the exact points of the array set them all to zero. To use the script go to new feature “point from function”, and paste this into the function. In the object field type {“Name of Coordinate System”, “Nameof your PointArray Here”}

should work.

function (CoordinateSystem cs, Point [][] pntArray)

{

{

int xOffset = 15;

int yOffset = 15;

int zMinOffset = 1;

int zMaxOffset = 40;

int i = pntArray.Count;

int k = pntArray.DeepestRank();

Point pntLast;

pntLast = new Point(this);

if(k>1)

{

int j = pntArray[i].Count;

Point pnt1;

Point pnt2;

pnt1 = new Point(pntLast);

pnt1.ByCartesianCoordinates(cs, xOffset, yOffset, zMinOffset, pntArray[i][j] );

pnt2 = new Point(pntLast);

pnt2.ByCartesianCoordinates(cs, (-1*xOffset), (-1*yOffset), zMaxOffset, pntArray[0][0] );

}

else

{

Point pnt1;

Point pnt2;

pnt1 = new Point(pntLast);

pnt1.ByCartesianCoordinates(cs, xOffset, yOffset, zMinOffset , pntArray[i] );

pnt2 = new Point(pntLast);

pnt2.ByCartesianCoordinates(cs, (-1*xOffset), (-1*yOffset),zMaxOffset, pntArray[0] );

}

}

}

Advertisements

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: