Persistent IDs of features owned by subassemblies

in a assembly document with subassemblies, the user select a distance mate owned by a subassembly, and i run the code (_selectionMgr and _modelDocExtension are fetch from the top level assembly document):


object selData = _selectionMgr.GetSelectedObject6(1, 0);

Feature feature = (Feature)selData;

object pidObject = _modelDocExtension.GetPersistReference3(feature);

byte[] pid = pidObject;

int ok = (int)swPersistReferencedObjectStates_e.swPersistReferencedObject_Ok;

object obj = _modelDocExtension.GetObjectByPersistReference3(pid.ToArray(), out int errorCode);
if (errorCode != ok) throw new Exception(\\\$"Failed to get object from persistent reference. Error code: {errorCode}");

obj = _modelDocExtension.GetCorresponding2((Feature)obj);

feature = (Feature)selData;

 

i want to be able do this cycle, where feature in the second code line is the same as feature in the last code line, because i want to save it across sessions. but GetCorresponding2 returns null, this would not be necessary if there would be subassemblies, it that case  GetObjectByPersistReference3 return already the usable feature. if the user select a distance mate owned by a subassembly, if i append to this code to get the Dimension of the Mate2 of the feature (last code line), dim.GetSystemValue3((int)swInConfigurationOpts_e.swThisConfiguration, null)[0] is always 0, but work if the user selects a distance mate owned by the top level assembly doc.