+ Reply to Thread
Results 1 to 3 of 3

Thread: Simply? getting Z values into attribute table

  1. #1
    Eric Peterson
    Join Date
    Sep 2010
    Posts
    2
    Points
    0
    Answers Provided
    0


    0

    Default Simply? getting Z values into attribute table

    This should be really simple and I'm surprized that an hour of looking through the forums and other support hasn't turned up an answer for me yet. Am I just being blind?

    I have a shapefile of 3D points, and I want to fill a field in the attribute table with the Z values. Calculate Geometry does not offer Z coordinate options. So I've tried using the Field Calculator with
    Dim Output As Double
    Dim pPoint As IPoint
    Dim pZAware as IZAware
    Set pPoint = [Shape]
    Set pZAware = pPoint
    pZAware.ZAware = true
    Output = pPoint.Z
    (and variants thereof)

    But all I get for output is the value '1'

  2. #2
    Eric Rice

    Join Date
    Oct 2009
    Posts
    954
    Points
    474
    Answers Provided
    76


    0

    Default Re: Simply? getting Z values into attribute table

    Eric,

    The Add XY Coordinates tool will add POINT_Z and POINT_M fields when the input feature is z- and m-enabled. It's located in Data Management Tools > Features. If you don't want the X, Y fields you can delete them and keep just the Z.

    In ArcGIS 10, the Calculate Geometry has the option to get the Z for a point dataset.

    I tested your code sample and it worked fine for me so there is nothing wrong with that. What does your dataset say in the Shape field? And how did the data get the Z values originally?


    Regards,
    Eric
    Eric Rice
    Product Engineer
    Esri Software Products

  3. #3
    Eric Peterson
    Join Date
    Sep 2010
    Posts
    2
    Points
    0
    Answers Provided
    0


    0

    Default Re: Simply? getting Z values into attribute table

    "Add XY Coordinates" did the trick!

    I'm at version 9.3.1 - looking forward to 10. My shape field reports "Point ZM". The file originated as a CSV with XYZ values, turned into a shape file with "ASCII 3D to Feature Class". My code may remain a mystery, but the overall problem is solved.

    Thanks!

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts