The Geosoft GX .NET API has two flavors consisting of two assemblies each. Refer to the .NET API reference links in the Documentation by Release.
The first flavor's namespace ends in GXNet
and is used for most extensions and stand-alone programs. This API is not thread-safe and all API calls should be used inside a single thread only. The second's namespace ends in GXNetX
and could be used where multiple threads use the API at the same time. Each thread should have its own CGX_NET
or CGXNETCore
context object, which will be the first argument passed to static methods and object creation methods.
The two assemblies split the available classes roughly into what is considered "Core" engine functionality (Geoengine.Core.*
namspace) and classes that are closer to what the full Oasis montaj Desktop suite offers (Geosoft.Desktop.*
namspace).
See GXDotNet repository examples
examples\CSharp\chanadd\ | Stand-alone console program to copy/convert grids using IMG class interface (C# version). |
examples\CSharp\OMScript\ | GUI program that can execute GS Scripts and GX’s in GUI mode (C# version). |
examples\CSharp\NewGDB\ | Example of an extension .Net GX to create a new GDB (same code that implements the montaj functionality). |
examples\CSharp\XToolControl\ | Sample Geosoft XTool with binding GX. |
The GX API can be used to create .NET DLLs that can be called directly from a Geosoft menu.
See the Documentation by Release for links to the .NET API reference documentation.
There are several different ways of connecting your code to the Geosoft environment of your choice:
A GeoXTool will launch as a dockable window inside the Oasis montaj. Once launched from a GX the process, it stays resident and responds to events within the environment. The tool should implement a user interface and once launched, it will be saved with the current project and recreated if the project is opened again. The CMETA object passed to bInitializeToolControl can be used to serialize information into the project and will automatically be recovered when the project is closed and reopened.
By creating a control descending from ToolControl, most of the plumbing is already taken care of.
This object can respond to the following events in the environment:
A sample of a .Net based GeoXTool with a GX that launches can be found at XToolControl.