.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Tony's old GetSymbolTableRecordId to get object id of table entry

6 REPLIES 6
Reply
Message 1 of 7
JamesMaeding
377 Views, 6 Replies

Tony's old GetSymbolTableRecordId to get object id of table entry

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

6 REPLIES 6
Message 2 of 7

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




______________
Yes, I'm Satoshi.
Message 3 of 7
jeff
in reply to: Dale.Bartlett

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

You can also find your answers @ TheSwamp
Message 4 of 7
JamesMaeding
in reply to: jeff

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

Message 5 of 7
jeff
in reply to: JamesMaeding

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

You can also find your answers @ TheSwamp
Message 6 of 7
JamesMaeding
in reply to: jeff

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

Message 7 of 7
SENL1362
in reply to: JamesMaeding

LOL

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost