4

I'm relatively new to the world of model builder and scripting, so it's likely there is a very simple solution to the question I've been trying to figure out.

I'm trying to create a tool that takes a given shapefile, interpolates it over a given surface, adds a "Length_3D" field, then calculates that length (3D) in the attribute table using the Calculate Field tool in the Data Management Toolbox. I've done the same for 2D length using !shape.length@miles! as the expression and I have no issues there.

What I can't seem to figure out is how to write an expression that will allow me to calculate the 3D length from my already interpolated line. Right now the model runs all the way through until this point then throws an error. I'm able to open the newly created ZM shape and calculate the 3D length by using the "Calculate Geometry" tool in the attribute table then selecting "3D Length". I'd really like to be able to perform this in the model though. Has anyone else had a similar issue or know how to write the expression? I've tried "!shape.3DLength@miles!, !shape.3D_Length@miles!, and !shape.3D Length@miles!" with no luck. Thanks!

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Oct 31, 2013 at 16:34
1

2 Answers 2

2

Try the following combination:

!shape.length3d!

Hope that helps!

answered Oct 31, 2013 at 18:54
1
  • Thanks for the suggestion, but that doesn't seem to be working either. I get the following error after running the model: ERROR 000539: Invalid property length3d. Valid properties: labelpoint, type, extent, truecentroid, firstpoint, lastpoint, ismultipart, hullrectangle, area, length, partcount, pointcount, centroid Commented Nov 6, 2013 at 21:42
2

!shape.length3D! does work.

I had to make sure that I selected the PYTHON_9.3 Expression type in the Calculate field Options dialog. (I'm running 10.2.)

Erica
8,9824 gold badges35 silver badges85 bronze badges
answered Oct 14, 2014 at 13:26

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.