3

I like field calculator and use it often, however found something very disturbing today when attempted to do this on a table of 3D feature class.

def abc(shp,id):
 return shp.length

----------------------

abc( !Shape!, !UNIQID!)

Returns:

Executing: CalculateField LINES L abc( !Shape!, !UNIQID! ) PYTHON_9.3 "def abc(shp,id):\n return shp.length"
Start Time: Mon Sep 12 12:30:28 2016
ERROR 000539: Error running expression: abc( GPVARIANTOBJECT0, L1 ) 
Traceback (most recent call last):
  File "<expression>", line 1, in <module>
NameError: name 'L1' is not defined

On this table:

enter image description here

The same expression works fine on 2d features. Moreover if I remove second argument and run it as:

def abc(shp):
 return shp.length
#----------------------
abc (!Shape!)

It also works as expected on table with 3D shapes.

So adding another variable to list of arguments results in a crush.

Somebody else can confirm this odd behaviour please.

I am working with 10.3.1 and it is happening only with second argument being text, numeric work fine.

I found a workaround by swapping arguments: abc(!UNIQID!,!Shape!)

Still weird.

UPDATE after @Midavalo comment:

Yes the same odd behaviour on 2D shapes

  • 1
    That is really odd, may be worth starting a support incident with ESRI so they can investigate and log it as a bug. – crmackey Sep 12 '16 at 2:18
  • 1
    what type of file? Shapefile or file gdb or other? – Midavalo Sep 12 '16 at 2:25
  • 1
    A quick test for me provided the same result, although for me it occurred on both the 2D and the 3D lines – Midavalo Sep 12 '16 at 2:33
  • I tested it on both shapefiles and FGDB classes – FelixIP Sep 12 '16 at 2:35
  • 2
    I agree with @crmackey - the best way forward is to log this with Esri Technical Support and, assuming that they can reproduce it, insist they provide a bug number that you can insert into a self-answer to your own question. – PolyGeo Sep 16 '16 at 8:09
0

On a question such as this, where you have described what appears to be a reproducible bug, and has been verified by another member of our community, I think the best way forward is to log it with Esri Technical Support and, assuming that they too can reproduce it, insist they provide a bug number that you can insert into a self-answer to your own question.

Remember from the help that:

We are not a GIS Software Support Site. We encourage you to seek official routes for support for specific issues you may have.

  • You are right, however it is a nightmare to deal with Esri Support Page – FelixIP Sep 20 '16 at 22:10
  • It does seem to be getting worse. I really wish Esri accepted incident reports internationally in a single central simple location. – PolyGeo Sep 20 '16 at 22:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.