Ad

Monday, October 27, 2008

Elevation Analysis - VBA Style

One of the items you can't seem to store in your template is how the Elevation analysis is applied to a surface. If you find yourself always changing the values to a default, this post may help you become more productive.

The first thing we need to do is select a surface. This is how I did it:

image

Once we have a surface then you can create the elevation analysis regions you want to the surface. This routine assumes that one has not been applied yet. If you already have created one, you may want to remove the existing one first or modify it.

image

In the sample above the code is creating 2 regions. If you want more just change the value. Once the regions are created we can change the properties of them. We do this by creating a new SurfaceElevation object. Next we have to set the values that we want to use for the regions. Here is the code to do it.

image 

Follow the pattern and do the same for additional regions. Like most of the examples on this site, no error catching has been added, such as On Error Resume Next line to get rid of an error message if the user didn't select an object. Have fun.

No comments:

LinkWithin

Blog Widget by LinkWithin

Ad