Creating features in ArcPad 10.2 have no attributes

781
1
09-08-2013 08:12 PM
DanikBourdeau
New Contributor III
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,
Tags (3)
0 Kudos
1 Reply
ChuckWright
New Contributor II
I am running into this right now - is there any resolution or workaround?

In my situation I am simply updating values in the onfeatureadded event.  I have tried other places in the event stack and it doesn't work there either.  Everything work as expected in 10.0.4 and earlier.
0 Kudos