Search code examples
c#.netautocadautocad-pluginobjectarx

Working through AutoCAD 2021 Labs, not sure what lab #5 is asking me to do


I'm working my way through these sample AutoCAD labs(AutoCAD 2021 .NET training) to get a feel for the system, and I'm really stuck on step #6 of lab #5. It asks me to "Check to see if the entry we are going to add to the dictionary is already there" using the "contains" property of a database dictionary(DBDictionary) in an if else statement. However, I can't seem to find any reference to what that entry actually is anywhere in the sample code or instructions. Step #7 Mentions an entity located within the aforementioned DBDictionary, but that seems like a particularly strange thing to search for, and even if it was what I was looking for I can't get a statement like that to work. I've tried. Any advice?


Solution

  • A DBDictionary could be compared to a generic Dictionary<string, DBObject> and a DBDictionary entry to a KeyValuePair<string, DBObject> (where the DBObject is typically an Xrecord). The use of DBDictionary instances is a way to store data in an AutoCAD Database alternatively to SymbolTable (see this topic).