Ask A Cartographer

topographic profile follow up

May 11 2009 | 0 comments
Categories: Map Data

Thanks for the quick response on the topo profile question.

Can you explain exactly what this is doing:

"3. Calculate the field using and advanced field calculate statement:

Dim pPoint As IPoint
Set pPoint = [Shape]
dblZ = pPoint.Z

set the value to = dblZ"

I'm not even sure what the variables are in this.

Does this go in the VB script window, or the lower z= window?

Mapping Center Answer:

It is calculating a field to equal the Z value of the feature associated with the row.

There are no variables to set.  It is the calculate statement that you use to compute the values in the new field. So it goes into the Field Calculator window. Note that to use this, you need to click the "Advanced" button first. Once you click that button, you will see tow empty entry boxes. Type the following into the topmost box, the one labeled "Pre-Logic VBA Script Code". Tip - you can select the code, right-click and choose Copy, and then paste it into the box.

Dim Output as Ddouble
Dim pPoint As IPoint
et pPoint = [Shape]
dblZ = pPoint.Z

Then type the following into the second text box to define it as the variable Output . Do not enclose it in quotes or brackets


Click OK.

The field should now contain your Z values.

To learn more on how to use VB Script Code in field calculator statements, click the Help button in the Field Calucaltor window.

If you would like to post a comment, please login.

Contact Us | Legal | Privacy |