I seem to be running into some issues migrating my code from 10.0.4 to 10.2. Here is an example of code that is causing some issues.Sub CreateSquare
Dim objSmpSqr, siteID, sqrID, nEast, nNorth, sizeX, sizeY, myRect
'Assigning values to variables
siteID = "Trial"
sqrID = 1
nEast = 389900
nNorth = 6446055
sizeX = 5
sizeY = 5
'Calcualting rectangle extent
Set myRect = Application.CreateAppObject("rectangle")
myRect.Left = nEast
myRect.Right = nEast + sizeX
myRect.Top = nNorth
myRect.Bottom = nNorth - sizeY
'Creating feature
Application.Map.Layers("Sample Squares").Editable = True
Application.Map.AddFeature myRect, False
'Assigning values to attributes
Set objSmpSqr = Map.SelectionLayer.Records
objSmpSqr.Bookmark = Map.SelectionBookmark
objSmpSqr.Fields("SITE_ID").Value = siteID
objSmpSqr.Fields("Square_ID").Value = sqrID
objSmpSqr.Fields("EASTING").Value = nEast
objSmpSqr.Fields("NORTHING").Value = nNorth
objSmpSqr.Fields("Area_m2").Value = myRect.Area
objSmpSqr.Fields("SizeX").Value = sizeX
objSmpSqr.Fields("SizeY").Value = sizeY
objSmpSqr.Update
'Cleanup
Application.Map.Layers("Sample Squares").Editable = False
Application.ExecuteCommand("clearselected")
Set objSmpSqr = Nothing
Set myRect = Nothing
End Sub
In 10.0.4 the above code works fine, creating the feature and writing the values to the attributes. In 10.2, the feature is created properly but none of the values are assigned to the attributes. The feature has blank attributes. Anyone know what has changed?Thanks,