Dag Reppen

ProcessBook Custom Docked Window Add-in (c#), Changing Context of ERD

Discussion created by Dag Reppen on Dec 6, 2013
Latest reply on Dec 16, 2013 by mhamel

Hello,

 

 I am creating a ProcessBook add-in that is a variation of the current Element Relative docked window. I have created the TreeView, but am having difficulty changing the context when a node is clicked. While I have written this type of code in a VBA macro, I have been unable to translate into a c# application. (see attempt below)

 
        private PBObjLib.Application app;
        private void trview_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            this.app = (PBObjLib.Application)app;
            ContextHandler ch = app.ContextHandlers.Item("E");
            Display MyDisplay = app.ActiveDisplay;
            ch.CurrentContext(MyDisplay) = e.Node.Name;
        }

 I suppose the two main areas that are giving me trouble are (1) establishing the 'app' variable as the currently open ProcessBook session and (2) finding the correct function to change the context.

 

Thank you for your assistance.

Outcomes