Author Topic: how can i find a entity by object's handle or objectid?  (Read 199 times)

0 Members and 1 Guest are viewing this topic.

netcai

  • Mosquito
  • Posts: 12
how can i find a entity by object's handle or objectid?
« on: March 31, 2018, 05:00:09 AM »
I want to create a connection in two objects.So I store an entity's handle in another's ExtensionDictionary,but when these two objects in a block or xref,or array,the entity's handle will changed.So the connection will be lost. I alse tried to use objectid,the problem is same.

Atook

  • Swamp Rat
  • Posts: 874
Re: how can i find a entity by object's handle or objectid?
« Reply #1 on: March 31, 2018, 05:21:31 PM »
I think the issue you're running into is that when you create an array or block from the first two entities the new entities created in the block or array have new handles/ObjectId, which is unrelated to either of the originals. If you want to keep track of the new entity, you'll need to store it's handle as well.

When I'm trying to link two entities together, I store the handle.