Home
Reply
Highlighted
Regular Contributor
Posts: 55
0
Accepted Solution

Is entity alive?

Hello,

 

Is there a way to find out if an entity is alive? (I believe it is the same as asking if an entity was not marked by lose(), but I might be wrong)

 

My problem is that I try to detolerize tedges of a face using api_replace_tedge_with_edge(). In some cases all calls api_replace_tedge_with_edge() succeed, but more often I have CHANGE_LOST_ENT : "attempt to change record marked as deleted" failure. This perhaps means that after the first edge was detolerized, some other edges are not alive anymore (is it correct interpretation?)

In cases like this it would be helpful to know if an edge is alive, is marked for deletion, etc. How can I achieve this?

 

Thank you!

Regular Contributor
Posts: 30

Re: Is entity alive?

One way could be maintaining a SPACOLLECTION instead of ENTITY_LIST of tedges.

Regular Contributor
Posts: 55
0

Re: Is entity alive?

You are right, actually I'm thinking about it.

But it looks like the entities are not deleted immediately, they are just marked for deletion. In this case must exist a method which can tell to a user that the entity is not alive anymore.

Spatial Employee
Posts: 151

Re: Is entity alive?

Hi

 

The bulletin board can be scanned after an API, unless you use the option 'bb_immediate_close.  With 'bb_immediate_close set to TRUE, bulletin boards are processed immediately at the end of an API.  otherwise they are processed at the start of the next API.  The articles pointed to by https://doc.spatial.com/get_doc_page/articles/h/i/s/History_and_Roll_a088.html explain in detail how the history data structures are set up.  Each time an ENTITY is changed, ENTITY::backup should be called.  This will create a bulletin recording the change.  The bulletins are aggregated into a bulletin board.  The global function current_bb allows you to get the current bulletin_board for scanning the history.  Scanning the history is going to be O(N) where N is the number of changes so you don't want to do it in other big loops.

 

hope this helps

 

Eric

Regular Contributor
Posts: 55
0

Re: Is entity alive?

Wow, there is no simple way to ask entity if it is marked for deletion!

Thanks Eric!

Regular Contributor
Posts: 30

Re: Is entity alive?

If an entity is marked for deletion (lost), it gets removed from SPACOLLECTION.