calculate shae tool no longer working

759
2
01-31-2011 10:48 AM
FrankVignati
Occasional Contributor II
awhile ago Dean Thevaos posted this tool that would move polygons to a known xy location so long there was an XY field in the polygon attribute table with the x coord and y coord seperated by a comma
it worked in 9.3.1 and no longer works in arcgis 10, anyone know why?

Dim pPolygon As IPolygon
Dim pArea As IArea
Dim pOrigin As IPoint
Dim sXYField As String
Dim dXY() As String
Dim dX As Double
Dim dY As Double
Dim pTransform As ITransform2D

sXYField = [XY]

If (Not IsNull([Shape])) Then
  Set pPolygon = [Shape]
  dXY = Split(sXYField, ",")
  dX = CDbl(dXY(0))
  dY = CDbl(dXY(1))

  If (Not pPolygon.IsEmpty) Then
    Set pArea = pPolygon
    Set pOrigin = pArea.Centroid
    Set pTransform = pPolygon
    dX = dX - pOrigin.X
    dY = dY - pOrigin.Y
    pTransform.Move dX, dY
  End If
End If

__esri_field_calculator_splitter__

pPolygon
0 Kudos
2 Replies
DuncanHornby
MVP Notable Contributor
Frank,

Have you looked at the help recently? ESRI are forcing people to go the way of Python and have made changes to how VB scripting functions. You need to make some minor changes to you script and they are documented here.  Basically drop your Dim statements.

Duncan
0 Kudos
FrankVignati
Occasional Contributor II
Frank,

Have you looked at the help recently? ESRI are forcing people to go the way of Python and have made changes to how VB scripting functions. You need to make some minor changes to you script and they are documented here.  Basically drop your Dim statements.

Duncan


i've tried six ways to sunday to get this to work by dropping various dim statements and it won't run in 10
guess it will have to be converted to python
0 Kudos