Pages: 1
- Sujet précédent - arcgis 9.3 remplissage d'une zone de liste grâce à une sélection - Sujet suivant
#1 Mon 23 February 2009 13:42
- jkranklader
- Participant occasionnel
- Date d'inscription: 16 Feb 2009
- Messages: 15
arcgis 9.3 remplissage d'une zone de liste grâce à une sélection
Bonjour,
Je cherche à remplir une listbox d'un formulaire à partir d'une sélection de plusieurs communes, le problème c'est qu'à chaque fois mon code renvoie ladernière valeur que je souhaite avoir. Un coup de main serait le bienvenu. Merci!!
Code:
Dim pmxdoc As IMxDocument
Set pmxdoc = ThisDocument
Dim pmap As IMap
Set pmap = pmxdoc.FocusMap
Dim ptable As ITable
Set ptable = pmap.Layer(0)
Dim pRline As IRubberBand
Set pRline = New RubberLine
Dim pLine As IGeometry
Set pLine = pRline.TrackNew(pmxdoc.ActiveView.ScreenDisplay, Nothing)
Dim pPoints As IPointCollection
Set pPoints = pLine
Dim psfilter As ISpatialFilter
Set psfilter = New SpatialFilter
Set psfilter.Geometry = pPoints
psfilter.SpatialRel = esriSpatialRelWithin
Dim pf_selec As IFeatureSelection
Set pf_selec = ptable
pf_selec.Clear
pf_selec.SelectFeatures psfilter, esriSelectionResultNew, False
Dim i As Integer
For i = 1 To pPoints.PointCount
Set psfilter.Geometry = pPoints.Point(i - 1)
pf_selec.SelectFeatures psfilter, esriSelectionResultXOR, False
Next i
pmxdoc.ActiveView.Refresh
Dim pcursor As ICursor
Set pcursor = ptable.Search(psfilter, False)
Dim prow As IRow
Set prow = pcursor.NextRow
Dim num_champ As Byte
num_champ = ptable.FindField("INSEE")
Do Until prow Is Nothing
Me.ListBox1.AddItem prow.Value(num_champ)
Set prow = pcursor.NextRow
LoopHors ligne
Pages: 1
- Sujet précédent - arcgis 9.3 remplissage d'une zone de liste grâce à une sélection - Sujet suivant


