I'm trying to update the locations of a point FeatureClass using a table.
I have joined the table to the featureclass, and am attempting to use Field Calculator to update the SHAPE field.
I found the following code snippet that does what I want:
def Update(shape, newX, newY): pnt = shape.getPart(0) pnt.X = newX pnt.Y = newY return pnt Update( !SHAPE! , !NEAR_X! , !NEAR_Y! )
which ends up looking like this:
When I try this on a test featureclass, with no joined fields (just 3 columns; shape, newX, newY) it works perfectly. However, when I try it on my real data, with the table joined, it will not work. It gives a 'Failed to execute' error, and the ever-joyful 'ERROR 999999: Error executing function.'
I have tried making a Feature Layer from the joined table, and that doesn't help either.
How do I properly refer to the field names to make this work?
EDIT: In response to @Emil Brundage - when running the query on the joined layer, I did use the tablename.fieldname structure, as per the image below.