I am developing an solidworks add-in where all faces of the body are stored in a C# Dictionary at the AddIn-Startup. The key of my dictionary is the PersistentID of the face and the value is an own implementation of a face class (the class contains the Face2 object, too).
My AddIn listens to the DPartDocEvents_NewSelectionNotifyEventHandler to recognize if the user selects a face by mouse. Afterwards I use the dictionary and the PersistentID of the new selected face to lookup my dictionary. For this example - if the user selects the face by mouse - everything works fine. Both the "ContainsKey" function of the dictionary and the IsSamePersistentID of the ModelDocExtension are able to find my face-object/are able determine the equality of persistent id.
If the user selects the faces by keycombination CTRL+A the event fires, too but both the dictionary lookup and the equality check fail.
Does anybody know if the persistent ids are recalculated if the keycombination is used? And if yes, how to handle it?
Here is my code snippet:
selectedFaces is my dictionary as described above.
List<object> tempSelectedFaces = new List<object>();
for (int y = 1; y <= SelectionManager.GetSelectedObjectCount2(-1); y++)
foreach (object face in tempSelectedFaces)
public string getObjectsPersistentIDAsString(object obj)
Thanks in advance.