IMMPxApplication mmPxApplication = IApplication as IMMPxApplication;
IMMSessionManager2 ObjMSessionManager = mmPxApplication.FindPxExtensionByName
("MMSessionManager") as IMMSessionManager2;
// If you this is a subtask you would get the node Id as a parameted in IMMPxSubtas.Execute Method.
int currentNodeId = currentNode.Id; bool blnBoolean = true;
// Acquiring the current session and session id
ObjMSession = ObjMSessionManager.GetSession(ref intNodeId, ref blnBoolean);
//Getting the current session’s version
IMMPxApplicationEx2 ObjPxAppEx= IMMPxApplication as IMMPxApplicationEx2;
IMMPxSDEVersion ObjPxSDEVersion = ObjPxAppEx.GetSDEVersion(pPxNode.Id, pPxNode.NodeType, true);