Given an objectid for a blockref with attributes, I am trying to create a list (ArrayList) of block insertions and their attributes using the structures below.
I know that I should be using classes instead of structures, but that will have to be a future task.
Suggestions are appreciated.
Well there's certainly better ways, but its difficult to suggest
anything without knowing more about the the context, and
what you need to do with the data you want to store in your
structs.
There's lots of ways to store and manipulate data in .NET.
Each can be more or less suitable for a given task. Some of
the parameters that determine that include things like how
frequently you need to access the data, do you need to
quickly locate data given some key, and so forth.
In the mean time, you might want to look into exception
handling and termination handling (try/catch and try/finally)
to ensure your objects are being disposed if an exception
occurs, because the code you show doesn't take any of
those precautions. Most of the AutoCAD .NET code you find
floating around here and elsewhere can serve as examples
that show how to deal with exceptions, and ensure that
disposable objects are disposed.
Exception handling and dealing with disposable objects are
more basic aspects of .NET programming, that one should
become familiar with before progressing to more advanced
things like desiging data structures.
Look into the 'Using' statement for automatically disposing
objects, and look at some of the code posted here to see
how its used.
The other thing you should consider, regardless of whether
you use structs or classes, is to encapsulate assignment of
members in the class/struct itself, rather than doing that
from the outside.
For example, you can define a constructor for a class or
a struct, that takes arguments which receive the values
that are assigned to the fields, and does the assignment
in the constructor. I'm not even sure if legacy VB allows
you to write constructors for structs, and if it doesn't
then it would be a new concept for someone migrating
from legacy VB, that they should become familar with.