Community
I'm trying to read AssocArrays created by the user, when they are created and later. The issue I'm running into is when users create an AssocArray and erase some items out of it, then save and reopen it still renders fine but when search the AssocArray object it believes the items are there.
I've attached a command that reads the assoc array.
[CommandMethod("READARRAY")] public static void READARRAY() { Document doc = Application.DocumentManager.MdiActiveDocument; using (DocumentLock lok = doc.LockDocument()) { using (Transaction trans = doc.TransactionManager.StartTransaction()) { PromptEntityOptions peo = new PromptEntityOptions("\nSelect an assoc array:"); PromptEntityResult per = doc.Editor.GetEntity(peo); if (per.Status == PromptStatus.OK) { AssocArray dbo1 = AssocArray.GetAssociativeArray(per.ObjectId); if (dbo1 != null) { AssocArrayRectangularParameters assocParams = (AssocArrayRectangularParameters)dbo1.GetParameters(); int maxY = assocParams.RowCount; int maxX = assocParams.ColumnCount; for (int x = 0; x < maxX; x++) { for (int y = 0; y < maxY; y++) { ItemLocator il = new ItemLocator(x, y, 0); bool isErased = dbo1.IsErased(il); if (isErased) doc.Editor.WriteMessage("\n" + x + ", " + y + "\n"); } } } else doc.Editor.WriteMessage("\nThat wasn't an assoc array ಠ_ಠ\n"); } doc.Editor.PostCommandPrompt(); trans.Abort(); } } }