I copied this into my code
// // This is a much better/faster solution that P/Invokes
// // AcDbSymbolTableRecord::getAt() directly from managed code:
public static class AcDbSymbolTable
{
// Acad::ErrorStatus AcDbSymbolTable::getAt(wchar_t const *, class AcDbObjectId &, bool)
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("acdb17.dll", CallingConvention = CallingConvention.ThisCall, CharSet = CharSet.Unicode,
EntryPoint = "?getAt@AcDbSymbolTable@@QBE?AW4ErrorStatus@Acad@@PB_WAAVAcDbObjectId@@_N@Z")]
public static extern ErrorStatus getAt(IntPtr symbolTable, string name, out ObjectId id, bool getErased);
}
public static ObjectId GetSymbolTableRecordId(SymbolTable table, string name)
{
ObjectId id = ObjectId.Null;
ErrorStatus es = AcDbSymbolTable.getAt(table.UnmanagedObject, name, out id, false);
return id;
}
public static ObjectId GetSymbolTableRecordId(ObjectId TableId, string name)
{
using (Transaction tr = TableId.Database.TransactionManager.StartTransaction())
{
SymbolTable table = (SymbolTable)tr.GetObject(TableId, OpenMode.ForRead);
try
{
return GetSymbolTableRecordId(table, name);
}
finally
{
tr.Commit();
}
}
}
and then was trying to figure out what to pass to which function to get the ID of the erased Linetype, and then trying to figure out how to unerase it.