The RegAppTable class is a symbol table that contains all registered application names in an AutoCAD drawing. Applications must register before attaching XData (extended entity data) to objects.
Autodesk.AutoCAD.DatabaseServices
System.Object
└─ RXObject
└─ DBObject
└─ SymbolTable
└─ RegAppTable
| Method | Return Type | Description |
|---|---|---|
Has(string) |
bool |
Checks if an application is registered |
this[string] |
ObjectId |
Gets registered app ObjectId by name (indexer) |
using (Transaction tr = db.TransactionManager.StartTransaction())
{
RegAppTable rat = tr.GetObject(db.RegAppTableId, OpenMode.ForRead) as RegAppTable;
string appName = "MyApp";
if (!rat.Has(appName))
{
rat.UpgradeOpen();
RegAppTableRecord ratr = new RegAppTableRecord();
ratr.Name = appName;
rat.Add(ratr);
tr.AddNewlyCreatedDBObject(ratr, true);
ed.WriteMessage($"\nRegistered application '{appName}'");
}
tr.Commit();
}using (Transaction tr = db.TransactionManager.StartTransaction())
{
RegAppTable rat = tr.GetObject(db.RegAppTableId, OpenMode.ForRead) as RegAppTable;
ed.WriteMessage("\nRegistered applications:");
foreach (ObjectId appId in rat)
{
RegAppTableRecord ratr = tr.GetObject(appId, OpenMode.ForRead) as RegAppTableRecord;
ed.WriteMessage($"\n {ratr.Name}");
}
tr.Commit();
}- Database - Contains RegAppTableId
- RegAppTableRecord - Registered application
- XData - Extended entity data