He wrote a function to get a tables objectid for an item of some name.
I've used the code for a long time, but the whole point of it was to deal with a bug when you use the other way of doing it, which is:
LayerTable lt = (LayerTable)tr.GetObject(db.LayerTableId, OpenMode.ForRead, false);
if (lt.Has(layerName)) {
layerId = lt[layerName]; //<--- Buggy per Tony
}
Is the bug still there? Do erased layers still get returned from that lt[layerName] code?
I am testing, but am not sure how to recreate an erased layer in the db.
I could try purge, but do not trust myself on this as I might be misunderstanding, and fooling myself is not an option since I use it so much.
thanks
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties
This is a good question. I am in the same position, however don't have an answer. Hopefully someone will chime in. Has TZ moved over to TheSwamp 100% ? CADZone.com is defunct also. Regards, Dale
Look at
http://www.theswamp.org/index.php?topic=42025.msg471504#msg471504
The indexer was changed to only return erased entites if your using the copy returned from IncludingErased.
The has method might still return true for erased entity but would make more sense to me if only when used on a SymbolTable returned from IncludingErased
When you say "using the copy returned from IncludingErased", what do you mean?
I understand some of the pieces on this but not all.
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties
This is what Including erased returns
public SymbolTable IncludingErased { get { SymbolTable table = this.Copy(); table.m_skipDeleted = false; return table; } }
It creates another managed wraper in Copy method
internal protected virtual unsafe SymbolTable Copy() { IntPtr unmanagedPointer = new IntPtr((void*) this.GetImpObj()); SymbolTable table = (SymbolTable) RXObject.Create(unmanagedPointer, false); table.m_skipDeleted = this.m_skipDeleted; return table; }
Just that it would be nice for the Has method to return true for erased objects only from the managed wrapper created in Copy method which IncludingErased returns
Hmm, I need to study more, as the Copy part is losing me.
I am starting to feel like a good t-shirt would be:
internal protected virtual unsafe Male Human()
as added to my tagline...
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties