I am writing a routine which carries out a series of calculations on an AutoCAD drawing, getting areas of polylines etc etc, but I have stumbled across a... "brainteaser" (certainly for my little VBA'd-to-death brain).
I allow the user to make a selectionset of objects they do not wish to be included in the calculation, and until now I have been storing their ObjectID, Layer name and Area in list boxes. They also have the ability to delete an object from the "Excluded" list. This is fine within the same session, HOWEVER, something I never checked is whether this data is persistant past a save. Which it isn't. When you close and re-open a drawing, the ObjectID of any given object is different to the last time you had it open.
I have toyed with the idea of creating "on-the-fly" excluded layers (with the extension "-excluded") for each object they select and then moving the object to that layer. This idea is fine for excluding an object, but what happens if there is more than one object on the same layer which is excluded (or for blocks, two with the same name)? How will my script know which to include in the calculations again?
I could, of course, store some additional data on the object for example its area, but this relies on the fact that the user will not change the area of the polyline past it being excluded from the calculations, and also will not work for blocks.
Anyone any suggestions?