Sorry I'm not very familiar with sketcher's codebase but it is clear that it just a list of objects, when something is deleted it is removed from the list and the following items now have a reduced index, the same thing happens with constraint, note that the actual Shape property of sketches also gets it's toponaming from OCCT. I was referring to these lists here: I like your idea to solve this issue and I believe you have already proposed it before, instead of keeping a copy of the geometry data with a "deleted" property I would prefer empty elements in the lists (with a deleted property to differentiate). I don't know if the geometry index are important at all since in the end it's the OCCT given names that get referenced outside the sketch but the constraint index are important for expressions, it's very noticeable when using carbon copy.
@abdullah how hard would it be to make the geometry or at least the constraint index permanent? If you have a desire to have a python accessible consecutive list to be used for example in loops we could have a separate property that stores the indexes of the non deleted elements. It might be a good idea to discuss these in a separate thread though as it is not exactly the same as the toponaming problem, just similar, it's the sketcher constraint/geometry index problem.
The objective is to merge the realthunder stuff, his code doesn't really cover everything, it covers sketcher (but not these indexes I think?) Part and Part Design. If it takes too long I guess we could do it in parts but IMO if it's possible we should strive to get all 3 merged.As a top-level note, I think that solving/improving the topological naming is a big goal for v0.21, but we could do this in steps: first do it for Sketches only in v0.21, and THEN do it for other things for v0.22. My fear is that solving the TNP for EVERYTHING in 1 giant step in v0.21 might be a very long road, and having solved it for sketches would solve many MasterSketch / DatumObjects combinations (you might see where this is coming from)