Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ArcPad-VBscript-自动填充属性_Vbscript_Arcgis - Fatal编程技术网

ArcPad-VBscript-自动填充属性

ArcPad-VBscript-自动填充属性,vbscript,arcgis,Vbscript,Arcgis,我正在使用以下脚本从一个图层中获取地块和地址信息,以填充新创建要素的属性表 没有返回错误,但我遇到的问题是,recordselect函数的内存中似乎有错误的信息。无论我把一个点放在哪里,它都会给出相同的包裹和地址。或者它实际上没有正确地执行IF函数 Sub Address Dim rsCurrentXY Set rsCurrentXY = Map.Layers("Violations").records rsCurrentXY.movelast Dim objXYShape Set objXY

我正在使用以下脚本从一个图层中获取地块和地址信息,以填充新创建要素的属性表

没有返回错误,但我遇到的问题是,recordselect函数的内存中似乎有错误的信息。无论我把一个点放在哪里,它都会给出相同的包裹和地址。或者它实际上没有正确地执行IF函数

Sub Address

Dim rsCurrentXY
Set rsCurrentXY = Map.Layers("Violations").records
rsCurrentXY.movelast
Dim objXYShape
Set objXYShape = rsCurrentXY.Fields.Shape
Dim pControls
Set pControls= Application.Map.selectionlayer.Forms("EDITFORM").Pages(“PAGE1”).Controls
Dim rsGrid
' Find corresponding map page to the valve point
Set rsGrid = Map.Layers("ACPA_parcels").records
rsGrid.movefirst

Do While Not rsGrid.eof
If rsGrid.fields.shape.Ispointin(objXYShape) Then
pControls("txtAddress").value = rsGrid.Fields("ADD1").Value

Exit Do
End If
rsGrid.Movenext
Loop


' Clean Up
Set rsCurrentXY = Nothing
Set objXYShape = Nothing
Set rsGrid = Nothing
End Sub
(我有另一个名为“PIN”的子程序,它会做完全相同的事情。) 当检查器激活自定义表单中各自的编辑框时,我调用了它们

谢谢你的帮助,
Robert

通过Application.Map.selectionlayer.Forms(“EDITFORM”)访问EDITFORM会有问题。无论何时使用EDITFORM上的控件,都应该使用ThisEvent.Object来发现所有对象。例如,如果您的事件处理程序是Page_OnLoad,则ThisEvent.Object将引用您的当前页面。您应该有如下代码:

Dim pPage1
Set pPage1 = ThisEvent.Object
Dim pControls
Set pControls = pPage1.Controls