XRecords can hold any number of elements of any supported type, and you can include lists that are bounded by delimiters having groupcode 102 with the values "{", and "}". See the docs for XData for an explaination of list delimiters.
I wouldn't design your system to require an excessive number of dictionaries with each holding an XRecord that contains only one or a few elements, because that would be much less efficient than fewer dictionaries/xrecords that use list delimiters to holds many elements or lists.
The more imporant part is that you only need to locate individual XRecords once. Once you have found them, you can simply cache their ObjectIds in program memory, and use that to access them afterward, rather than having to do some sort of keyed/indexed lookup every time you need to access the data.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com
Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm
wrote in message news:6033425@discussion.autodesk.com...
I have a variable-length list of elements, which I would like to store in the drawing. The list might be modified by adding or deleting elements.
My plan is to use a dictionary keyed by "elD" where D is a unique index within the list. There would be an "Length" key to tell me how many Ds I have to look through (as some D's might be missing if an element is deleted). Then, the value at a certain key would just be the XRecord of an element.
My question is: Do you think that's a good way to store variable-length lists? Is there a simpler, perhaps more built-in approach?
Thanks.