Hi!
This is quite complex, and to be honest it's too far under the hood for me to really access it.
Here is what I can tell you about it:
How isolate selection functions and what is created/deleted when the button is activated/deactivated is handlet by a internal mel procedure called "modelPanelBarIsolateSelectCallback" which runs on the change command of the iconTextCheckBox "isolateSelectBtn".
#Python Query for chancecommand on isolate select button
iconTextCheckBox("MainPane|viewPanes|modelPanel4|modelPanel4|modelEditorIconBar|flowLayout6|formLayout46|IsolateSelectedBtn", q=True, cc = True )
#Result
modelPanelBarIsolateSelectCallback("IsolateSelectedBtn", "MainPane|viewPanes|modelPanel4|modelPanel4|modelPanel4", "MainPane|viewPanes|modelPanel4|modelPanel4|modelEditorIconBar"); restoreLastPanelWithFocus();
Sadly when looking for this procedure on my computer I couldn't find anything and googling for it only gave me wrap functions that call this function as is...
My guess is that this function creates either a global variable that stores the information as to which modelpanel belongs to which set, or the information is stored somewhere on a hidden UI element withing MainPane or viewPanes.
Now, I honestly never looked into this before today, because whenever I needed to find the objetSet that is connected to a modelPanel, I just used the "isolateSelect" command to query it.
string $mP = "modelPanel4";
string $vo = `isolateSelect -q -vo $mP`;
print($vo)
Could that might be helpful for what you are trying to do?