In
this thread, Tony T gives a nice workaround for the Symbol Table Indexer problem (the one where things like blocktable["BlockName"] may return an erased entity).
Essentially, the solution is to do a PInvoke of a method that is not exposed in the managed API. It contains some rather scary-looking 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);
}
Anyone care to dissect this, and explain exactly what is going on? Especially that EntryPoint stuff, with that long string of info. Where does all that stuff come from? I found the documentation for the System.Runtime.InteropServices.DllImportAttribute class, with it's EntryPoint method. I also found where it says to declare the method as a "static extern" in the C# prototype. But I'm still confused about how to figure out what to use in the EntryPoint.
I saw something about using "dumpbin" or "link". Is that what I need to do? Do I need to download and install VS Express C++ edition for it, or do something else?