Friday, 28 October 2011

ArcFM Snippet #1 - To get Current Session ID and Current Session's Version


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);

1 comment:

  1. Patricia Alanis4 April 2013 at 09:03

    Thanks, I loved the phrase at the begging :D and obviously the help about the Session ID. Keep helping us.

    ReplyDelete