0

In the middle of a ModelBuilder tool I created, I have a Z enabled feature with multiple polygons. I want to add on a specific field of this feature, the lowest Z value of each polygon. I know this is easy to do using calculate geometry, but this option is not available on ModelBuilder and the "Add Z Information" tool is giving me error 00245 and the "Add surface information" is taking to long to process.

So I want to do this using a Python expression on the calculate field tool.

If this is possible, what expression can I use?

  • 2
    What have you tried? Did you review the accessor functions for the Geometry type? The extent property looks promising... You'll need to choose Python or VB to make this a single question. – Vince Sep 4 at 19:53
  • I think python is better. I know that if you have a polyline and want to fill a field with the Z coordinate of the first vertex you can use the expression: !Shape.firstPoint.Z!. I was trying something similar, I thought that I could just type !Shape.minimumPoint.Z!, but it doesn't work. Other than that I have no idea how to develop this expression. – Felipe Gonçalves Sep 5 at 11:43
  • As stated, Geometry.extent returns an Extent, which has minimum/maximum properties. This is a one-liner, very similar to what you already have. – Vince Sep 5 at 13:09
  • Thanks. Yes, it is pretty simple. just needed to write !Z_Min! as the expression and it worked! – Felipe Gonçalves Sep 5 at 13:25
  • That extracts from a field named Z_Min, which may or may not correlate to the actual value in the geometry. – Vince Sep 5 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.