How to get Point Feature Z value

489
3
Jump to solution
05-20-2012 01:02 AM
GSKTRYG
New Contributor III
Hi,

I am working on a Python script to import a cad dwg into a gdb file.
For Point features, I need to set its XYZ Values as attributes.
I am getting the X,Y value from the point as
        x= "float(!SHAPE.CENTROID!.split()[0])"
        y= "float(!SHAPE.CENTROID!.split()[1])"

Can anyone suggest me how to get a point Z Value ?


Regards,
Siva
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
BruceNielsen
Occasional Contributor III
Have you tried row.HEIGHT = zVal ( I assume you're using an UpdateCursor)?

View solution in original post

0 Kudos
3 Replies
GSKTRYG
New Contributor III
Hi,

I got the Z value from the point by -
zVal = row.shape.extent.ZMax

but, when I try to set this value to a field, its not working.
row.SetValue ("HEIGHT", zVal)

any help?

Siva
0 Kudos
BruceNielsen
Occasional Contributor III
Have you tried row.HEIGHT = zVal ( I assume you're using an UpdateCursor)?
0 Kudos
GSKTRYG
New Contributor III
Have you tried row.HEIGHT = zVal ( I assume you're using an UpdateCursor)?


Yes. 'UpdateCursor' solved it. previously I tried within the SearchCursor.
Thanks bruce.nielsen
0 Kudos