Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Disclaimer: I am basically brand new to VB.NET and ArcObjects.

I am computing some statistics as a component of a larger arcobject script. I write these components to an ITable. This ITable is added to the map display as a standalone table.

I find that I am duplicating a fair bit of code to assign a value to each field in the table. This is not something I would do in Python and wonder if a better methods applies in the VB.Net world.

VB.NET CODE:

   'Populate the stats table with the iteration.
    Dim row As IRow = tTable.CreateRow
    Dim fields As IFields = row.Fields

    Dim fThres As Double = fields.FindField("ThreshDist")
    row.Value(fThres) = lStats(0)
    row.Store()

    Dim fCountR As Double = fields.FindField("CountR")
    row.Value(fCountR) = lStats(1)
    row.Store()

where lStats is a list of doubles, and tTable is an ITable object.

In python I would simply use a dictionary to map the index (as key) to the fields name, as value. A simple for loop would take care of population using an insert cursor.

Does a similar paradigm exist using VB.Net? Am I missing something obvious in the documentation?

share|improve this question

1 Answer 1

Check out this page is shows you the types of cursors ArcObjects uses and gives examples in VB .net

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.