Pre-Logic Script Code: dim dblx as double dim dbly as double dim pPoint as Ipoint set pPoint = [Shape] dblx = pPoint.x dbly = pPoint.y Field= dbly
The Add XY coordinates tool pulls the XY coordinates from the shape field. This would be useful for models when you needed to add the fields and also find the X and Y values. It will save a few steps. This tool will also give the Z or M values from the shape field as well if they were enabled on the feature class when it was made. See this link for more information on the tool:http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000032000000.htmTo do a field calculation with the Python parser, see this sample script.Pre-Logic Script Code:def find(shape): point = shape.getPart(0) return point.XNewX = find(!Shape!)This code is a sample modified from the Code samples -geometry section found on this link:http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005s0000002m000000.htm
def find(shape): point = shape.getPart(0) return point.X
find(!Shape!)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.