Ad

Monday, January 19, 2009

Create Point Relative to Elevation

This post is going to build on the Create Points with Elevation post I did last month. Instead of creating the point with elevation at the point selected, this will create a point relative to another point and let the user type in an elevation difference.

The code from the last post is below:

image

The first thing that needs to be done is to change the "Select Point to something more appropriate, maybe "Select Reference Elevation Point: ". Now we need to ask the user to specify the location where the point needs to be created at. Do do that we'll need to create a vPoint2 variable to store the point location.

image

Next we need to prompt the user the elevation difference the user wants to use. The code below prompts the user for that information.

image

There is some error catching to use a default value. If the user hits enter or spacebar the default value of -0.5 is used. The On Error Resume Next has the code go to the next line of code instead of sending an error message to the user. So now we have all of the information we need to create the point. The lines of code below creates the point.

image

To save you some time the completed code may be found on this page.

No comments:

LinkWithin

Blog Widget by LinkWithin

Ad