{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["img"]},"type":"markdown"},"seo":{"title":"Getting Started","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":true,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"getting-started","__idx":0},"children":["Getting Started"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Obtain an Ocean developer license"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Follow the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/ocean-petrel/installation"},"children":["installation instructions"]}," of the Ocean SDK"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"quick-tutorial","__idx":1},"children":["Quick Tutorial"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"get-object-type---right-click-context-menu-plugin","__idx":2},"children":["Get object type - right click context menu plugin"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This simple plugin provides a way to fetch the type of a selected data object in the Petrel panes. This is very useful when developing plugins so you can find the matching data objects in Ocean to interact with in more complex plugins."]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/13---get-object-type-context-menu.4ebc029e93884bfeeac3b54dc40e2a3eed735264dfeef5adff3b123ab4c34850.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/14---get-object-type-result.2e2918dd2b2e8ecb064ff23854885f31e5f748480b745e57a48592cdf7dd9950.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"open-visual-studio-and-create-a-new-project","__idx":3},"children":["Open Visual Studio and create a new project"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Search for the Ocean Plug-in template"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Ocean Plug-in"]}," and click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/01---create-ocean-plugin.2ed866fb1b417cfe4d5b82217ad5783abbc3ef901844b35fe6bebfb5461fbca7.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Give your project a name and click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create"]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/02---create-project.bc1051570888ccc514f135d58b3e17b84770fdab38de7e0dfe479f58d1eba4fe.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"the-ocean-project-wizard-will-pop-up","__idx":4},"children":["The Ocean Project Wizard will pop up"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Give your plugin class a valid name"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Recommend providing a unique class name as you may come back later and add more plugins to your solution."," ","The other metadata can be modifed later on in the code."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create new module"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Register modules in this solution"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/03---ocean-wizard---step-1.fabf923ba0c08dbaf457504c6e1295934f40f0f4e75048242d55eb641bd92d68.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ensure your new module is checked and click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/04---ocean-wizard---step-2.7b5bceb13f19a7ddb866ec49b91a2ef0c48ce02625a3e255fa2fd6910e2799dd.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Provide a unique name for the new module which will contain a new command handler for the code to be executed."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New Command"]}," and provide a unique name for the command handler."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/05---ocean-wizard---step-3.debb43ba50d7982eaf960fd1113785562f276fced1c3ca065b3a6dff4d654388.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In this step you need to register the command that will be executed when you click on ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Get Object Type"]}," in the context menu"]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":8},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click on the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Add new command"]}," button to insert a new command under the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Commands"]}," item."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select the command and update the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Id"]}," to an appropriate name."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Update the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Caption"]}," so it is more descriptive of the action it will perform, ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["this will be the text shown in the context menu"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/06---ocean-wizard---step-4.b6ad263041c164608021134a22b684fc7a8977826f5c6ab04f4041b6edc5766f.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Finish"]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/07---ocean-wizard---step-5.ce2711809c02f2de2258db98beb03cbbf21e7de9e29b97f61caac93d2f5b4a4f.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"visual-studio-project","__idx":5},"children":["Visual Studio Project"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once your project is created, the Solution Explorer should look something like this:"]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/09---vs-solution-explorer.1c8471f8227d6505e12869bad14c4885e176c6ec37db0e0826e0347c131561c7.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Module"]}," class and under the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["IntegratePresentation"]}," method, register the context menu item like so:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"SimpleCommandContextMenuHandler<object> otHandler = new SimpleCommandContextMenuHandler<object>(new CommandItem(ObjectTypeCommandHandler.ID));\nPetrelSystem.ToolService.AddCommandContextMenuHandler(otHandler);\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/10---vs-implement-context-menu.e1958565eeb0037908c0d932664b4bdb6a6177322aa4c3a231c8af1ba41bd9ec.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["CommandHandler"]}," class and implement the logic that will run when the user clicks on the ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Get Object Type"]}," item in the context menu."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This will loop through the selected objects in the data trees and print the type to the message log in Petrel."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"foreach (object obj in context.GetSelectedObjects<object>())\n{\n    PetrelLogger.InfoOutputWindow(\"Object type: \" + obj.GetType().ToString());\n}\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/11---vs-implement-execute-method.fdda08a9228fc7c19849a57a2b81b26cf570a99ca8a8af132f5da48c1d8bb97b.a151ee85.png","alt":"Create Ocean Plug-in","withLightbox":true,"width":"","height":""},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then you can build the project, and if all goes well the plugin will be created and added to Petrel automatically."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Launch Petrel and test the plugin"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You have successfully created your first plugin!"]}]},"headings":[{"value":"Getting Started","id":"getting-started","depth":1},{"value":"Quick Tutorial","id":"quick-tutorial","depth":3},{"value":"Get object type - right click context menu plugin","id":"get-object-type---right-click-context-menu-plugin","depth":4},{"value":"Open Visual Studio and create a new project","id":"open-visual-studio-and-create-a-new-project","depth":4},{"value":"The Ocean Project Wizard will pop up","id":"the-ocean-project-wizard-will-pop-up","depth":4},{"value":"Visual Studio Project","id":"visual-studio-project","depth":4}],"frontmatter":{"seo":{"title":"Getting Started"}},"lastModified":"2025-05-21T14:03:30.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/ocean-petrel/getting-started","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}