1

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?

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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