Search code examples
c#oceanpetrel

How to change the name of petrel window programatically


I am trying to make a petrel plugin which demands output in the form of function graphs and histograms. Can i name the function windows programatically?


Solution

  • Yes you can rename a FunctionWindow using INameInfoFactory.

                INameInfoFactory nameFactory = (null != funcWindow) ? CoreSystem.GetService<INameInfoFactory>(funcWindow) : null;
                var nameInfo = (null != nameFactory) ? nameFactory.GetNameInfo(funcWindow) : null;
                if (null != nameInfo && nameInfo.CanChangeName)
                {
                    nameInfo.Name = windowName;
                }