### C# Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/markdown/6b88348c-c8c0-4025-79ca-9b740e7aefd0.md Example demonstrating how to load a raster adaptor and use the Search method to get all adaptors in the chain. ```APIDOC ## Example Usage (C#) ### Description This example shows how to load a raster adaptor from a file and then use the `Search()` method to retrieve all associated raster adaptors in the chain. ### Code ```csharp RasterAdaptor dtedFile = RasterAdaptor.Load(@"C:\tesetdata\w116n30.dt2"); InterpolateIDWRasterAdaptor idw = new InterpolateIDWRasterAdaptor(dtedFile); // Result will contain two elements: GdalRasterAdaptor, InterpolateIDWRasterAdaptor RasterAdaptor[] allAdaptors = idw.Search(); ``` ``` -------------------------------- ### Get or Set ICoordSystem GUID (VB) Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/markdown/P_Intergraph_CoordSystems_CoordSystem_Intergraph_CoordSystems_ICoordSystem_GUID.md This VB.NET snippet demonstrates the implementation of the GUID property for the ICoordSystem interface. It uses standard Get and Set accessors. ```vbnet Private Property GUID As String Implements ICoordSystem.GUID Get Set End Property ``` -------------------------------- ### SmartStore Profile Configuration Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/smartstore_profile_format.md This example shows the basic key-value pair structure for the SmartStore profile file. Ensure security precautions are taken as it may contain sensitive information like database passwords. ```text DATABASETYPE=Access.GDatabase DATABASENAME=C:\Warehouses\USSampleData.mdb CONNECTSTRING= CONNECTNAME=USSampleData ALIASTABLE=GAliasTable COORDSYSTABLE=GCoordSystem MAPFILENAME=C:\Warehouses\SmartStoreDemo.ddc COORDSYSFILENAME=C:\Warehouses\SmartStoreDemo.csf ``` -------------------------------- ### Get or Set ICoordSystem GUID (C#) Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/markdown/P_Intergraph_CoordSystems_CoordSystem_Intergraph_CoordSystems_ICoordSystem_GUID.md This C# snippet shows the signature for getting or setting the GUID property of an ICoordSystem object. It is a standard property access. ```csharp string ICoordSystem.GUID { get; set; } ``` -------------------------------- ### Show Help for InstallAppCmd Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/installappcmd.md Use the -h, /h, -H, /H, -?, or /? flags to display the help information for the InstallAppCmd utility. ```bash InstallAppCmd -h ``` ```bash InstallAppCmd /h ``` ```bash InstallAppCmd -H ``` ```bash InstallAppCmd /H ``` ```bash InstallAppCmd -? ``` ```bash InstallAppCmd /? ``` -------------------------------- ### Get or Set ICoordSystem GUID (F#) Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/markdown/P_Intergraph_CoordSystems_CoordSystem_Intergraph_CoordSystems_ICoordSystem_GUID.md This F# snippet illustrates the abstract and overridden implementation of the GUID property for the ICoordSystem interface. It uses F# property syntax with get and set accessors. ```fsharp private abstract GUID : string with get, set private override GUID : string with get, set ``` -------------------------------- ### Connect and Disconnect Library Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/4192.md This code snippet shows how to establish and terminate a connection to a library. It includes setting connection parameters like name, description, mode, and connection string, as well as displaying the connection status. ```vbnet Option Explicit On Imports PLSS = Intergraph.GeoMedia.PLSS Public Class Form1 Dim m_objLibraryConnection As PLSS.LibraryConnection Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load m_objLibraryConnection = New PLSS.LibraryConnection End Sub Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConnect.Click ListBox1.Items.Clear() With m_objLibraryConnection .Name = "Access Library Connection 1" .Description = "Library" .Mode = PLSS.LibraryConnectionConstants.gmlcModeReadOnly .ConnectionString = "TYPE=GDO;PROGID=ACCESS.GDatabase;LOCATION=D:\Warehouses\Library.mdb;SOURCE=" .Connect() End With With ListBox1 .Items.Add("Library connection name: " & m_objLibraryConnection.Name) .Items.Add("Library connection description:" & m_objLibraryConnection.Description) .Items.Add("Connection string:" & m_objLibraryConnection.ConnectionString) If m_objLibraryConnection.Status = PLSS.LibraryConnectionConstants.gmlcStatusClosed Then .Items.Add("Library connection is closed.") Else .Items.Add("Library connection is open.") End If End With End Sub Private Sub cmdDisConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDisConnect.Click ListBox1.Items.Clear() m_objLibraryConnection.Disconnect() With ListBox1 .Items.Clear() .Items.Add("Library connection name: " & m_objLibraryConnection.Name) .Items.Add("Library connection description:" & m_objLibraryConnection.Description) .Items.Add("Connection string:" & m_objLibraryConnection.ConnectionString) If m_objLibraryConnection.Status = PLSS.LibraryConnectionConstants.gmlcStatusClosed Then .Items.Add("Library connection is closed.") Else .Items.Add("Library connection is open.") End If End With End Sub End Class ``` -------------------------------- ### Get or Set GUIDType in C# Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/markdown/P_Intergraph_CoordSystems_CoordSystem_Intergraph_CoordSystems_ICoordSystem_GUIDType.md This snippet shows the syntax for getting or setting the GUIDType property in C#. The property is an integer representing the GUID type. ```csharp int ICoordSystem.GUIDType { get; set; } ``` -------------------------------- ### Rich Text Configuration Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/rich_text,_serve_rich_text.md Example demonstrating how to set a specific font with bold and scaling, and a default font with scaling for rich text serving. ```ini [RICH TEXT] FONT Arial =b,fscale:0.01 DEFAULT FONT=Courier New, fscale:0.001 ``` -------------------------------- ### Example Configuration for Domain Authentication Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/188760.md An example of setting both REMOTE_OS_AUTHENT and OS_AUTHENT_PREFIX for domain authentication. Ensure to restart the database instance after applying these settings. ```sql REMOTE_OS_AUTHENT=TRUE OS_AUTHENT_PREFIX="DA_" ``` -------------------------------- ### Get or Set AzimuthStart Property (F#) Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/markdown/P_Intergraph_CoordSystems_IUnitAndFormatSpec_AzimuthStart.md Use this property to get or set the starting reference position for azimuths. The value must be of type CSAzimuthStartConstants. ```fsharp abstract AzimuthStart : CSAzimuthStartConstants with get, set ``` -------------------------------- ### Get or Set AzimuthStart Property (C++) Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/markdown/P_Intergraph_CoordSystems_IUnitAndFormatSpec_AzimuthStart.md Use this property to get or set the starting reference position for azimuths. The value must be of type CSAzimuthStartConstants. ```cpp property CSAzimuthStartConstants AzimuthStart { CSAzimuthStartConstants get (); void set (CSAzimuthStartConstants value); } ``` -------------------------------- ### Warehouse Configuration File Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/155299.md This example shows how to map graphic component views to flattened views and set an option in a warehouse configuration file. ```ini [FLATTENED VIEWS] V_BUILDING_AR=BULDING_FLAT_VIEW V_ADDRESS_PT=ADDR_TABLE [JOIN] IGNORE INVALID MAPPING=TRUE ``` -------------------------------- ### Initialize MFRandom Object Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/mfrandom.md Demonstrates how to create a new instance of the MFRandom object. This is the first step before configuring and executing operations. ```vbscript Dim opRandom Set opRandom = New MFRandom ``` -------------------------------- ### Get or Set AzimuthStart Property (VB) Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/markdown/P_Intergraph_CoordSystems_IUnitAndFormatSpec_AzimuthStart.md Use this property to get or set the starting reference position for azimuths. The value must be of type CSAzimuthStartConstants. ```vb Property AzimuthStart As CSAzimuthStartConstants Get Set End Property ``` -------------------------------- ### Get or Set AzimuthStart Property (C#) Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/markdown/P_Intergraph_CoordSystems_IUnitAndFormatSpec_AzimuthStart.md Use this property to get or set the starting reference position for azimuths. The value must be of type CSAzimuthStartConstants. ```csharp CSAzimuthStartConstants AzimuthStart { get; set; } ``` -------------------------------- ### Example: Open Specific FSM File Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/command_line_syntax.md Opens the DefSymFile utility and preloads the specified FSM file into the GUI. ```bash DefSymFile x:\symbols\basemap.fsm ``` -------------------------------- ### PageSetup Method Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/PageSetup.md The PageSetup method is used to interact with the print setup dialog. It takes several object and string arguments to configure the setup process. ```APIDOC ## PageSetup ### Description Initializes and displays the PageSetup dialog. ### Method Signature PageSetup(pMapviewDispatch As Object, pPrefSet As Object, appName As String, helpFilename As String, objUOM As Object) ### Parameters #### Input Parameters - **pMapviewDispatch** (Object) - Required - Dispatch object for the map view. - **pPrefSet** (Object) - Required - Preference set object. - **appName** (String) - Required - The name of the application. - **helpFilename** (String) - Required - The filename for help documentation. - **objUOM** (Object) - Required - Unit of measure object. ``` -------------------------------- ### Set Active Revision Set Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/Gtm_untitled00000028.md This example shows how to set an active revision set using the SetActiveRevisionSet method. It includes database connection and transaction setup. ```VB Public Sub GTMExample() On Error GoTo ExitSub Set m_DB = CreateObject("OracleOLTTRW.GDatabase") Call m_DB.OpenDatabase( "Oracle", , False, , "Scott/Tiger") Set m_TransExt = m_DB.GetExtension("Transaction") Call m_TransExt.SetActiveRevisionSet("RevisionSet1" ) Set m_TransExt = Nothing m_DB.Close Set m_DB = Nothing Exit Sub ExitSub: MsgBox Err.Description End Sub ``` -------------------------------- ### Get Raster Position Info Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/4211.md Use this snippet to get position information for a raster image. Ensure that the RasterPropertiesService and RasterGeometry objects are properly initialized and the filename is set. ```vb Option Explicit On Imports PRaster = Intergraph.GeoMedia.PRaster Imports PCSS = Intergraph.GeoMedia.PCSS Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim RasterServ As PRaster.RasterPropertiesService Dim RasterGeometry As PRaster.RasterGeometry Dim Position As Object = Nothing, dispMatrix As Object = Nothing Dim dispCoordSystem As PCSS.CoordSystem = Nothing On Error Resume Next RasterServ = CreateObject("Geomedia.RasterPropertiesService") RasterGeometry = CreateObject("GeoMedia.RasterGeometry") RasterServ.Filename = "C:\images\myimage.bmp" RasterServ.GetPositionInfo(PRaster.ImagePositionConstants.gmipDefault, dispMatrix, Position, dispCoordSystem) If Err.Number = 0 Then RasterGeometry.DisplayMatrix = dispMatrix RasterGeometry.FileName = RasterServ.FileName .......... End If End Sub End Class ``` -------------------------------- ### Example: Open DefSymFile without Arguments Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/command_line_syntax.md Launches the DefSymFile utility without any command-line arguments, displaying the GUI without a preloaded FSM file. ```bash DefSymFile ``` -------------------------------- ### AzimuthStart Property Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/markdown/P_Intergraph_CoordSystems_IUnitAndFormatSpec_AzimuthStart.md Gets or sets the starting reference position for azimuths. This property is of type CSAzimuthStartConstants. ```APIDOC ## AzimuthStart Property ### Description Sets or returns the starting reference position (North, South, East, or West) for azimuths. ### Property Value Type: CSAzimuthStartConstants ``` -------------------------------- ### Initialize MapView and LegendView Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/4428.md Sets up the MapView and LegendView controls with initial parameters like coordinate systems, background color, and mouse pointer. ```vb Option Explicit On Imports PClient = Intergraph.GeoMedia.PClient Imports MapViewLib = Intergraph.GeoMedia.MapviewLib Imports PView = Intergraph.GeoMedia.PView Imports PDBpipe = Intergraph.GeoMedia.PDBPipe Imports PCSS = Intergraph.GeoMedia.PCSS Public Class Form1 Dim objConn As New PClient.Connection, objOPipe As PClient.OriginatingPipe Dim objXFormPipe As PDBpipe.CSSTransformPipe Dim objRLE As PView.LegendEntry Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Set MapView parameters With GMMapView1 .CoordSystemsMgr = New PCSS.CoordSystemsMgr With .CoordSystemsMgr.CoordSystem .BaseStorageType = PCSS.CSBaseStorageConstants.csbsProjected .RefSpaceMgr.ProjSpace.ProjAlgorithmVal = PCSS.CSProjectionAlgorithmConstants.cspaRobinson End With .Legend = New PView.Legend .BackgroundColor = RGB(255, 255, 204) .MousePointer = MapViewLib.CursorTypeConstants.gmmvctNWArrow End With ' Set LegendView parameters GMLegendView1.Top = 0 GMLegendView1.Left = 0 GMLegendView1.Height = 100 GMLegendView1.Width = 125 GMLegendView1.Legend = GMMapView1.Legend ' Create connection With objConn .Location = "D:\Warehouses\USSampleData.mdb" .Mode = PClient.ConnectionConstants.gmcModeReadOnly .Type = "Access.GDatabase" .Name = "Connect1" .CoordSystemsMgr = GMMapView1.CoordSystemsMgr .Connect() End With ' Create recordset of States objConn.CreateOriginatingPipe(objOPipe) objOPipe.Table = "States" ' Transform the recordset to the MapView projection objXFormPipe = CreateObject("Geomedia.CSSTransformPipe") objXFormPipe.InputRecordset = objOPipe.OutputRecordset objXFormPipe.InputGeometryFieldName = "Geometry" objXFormPipe.CoordSystemsMgr = GMMapView1.CoordSystemsMgr ' Create legend entry for states objRLE = CreateObject("Geomedia.LegendEntry") Dim objStyleService As New PView.StyleService Dim objstyle As PView.StyleDefinition = Nothing objStyleService.GetStyle("Area Style", objstyle) 'Specify boundary style Dim objstyleB As PView.StyleDefinition objstyleB = objstyle.StyleDefinitions(0).StyleDefinitions(0) objstyleB.StyleProperties(PView.StylePropertyConstants.gmgroPropertyWidth).Value = 35 objstyleB.StyleProperties(PView.StylePropertyConstants.gmgroPropertyColor).Value = RGB(0, 0, 100) ' Specify fill color Dim objstyleF As PView.StyleDefinition objstyleF = objstyle.StyleDefinitions(1).StyleDefinitions(0) objstyleF.StyleProperties(PView.StylePropertyConstants.gmgroPropertyColor).Value = RGB(0, 150, 200) ' Specify pre-defined Hatch style Dim objstyleH As PView.StyleDefinition = Nothing objStyleService.GetStyle("Simple Fill Style", objstyleH) objstyleH.StyleProperties(PView.StylePropertyConstants.gmgroPropertyFillType).Value = PView.StyleFillTypeConstants.gmgroFillTypeDiagonalCross objstyleH.StyleProperties(PView.StylePropertyConstants.gmgroPropertyColor).Value = RGB(230, 230, 230) ' Append the pre-defined Hatch Style to the Fill type collection objstyle.StyleDefinitions(1).StyleDefinitions.Append(objstyleH, 0) Dim objpropertyT As New PDBpipe.GMProperty Dim objpropertyS As New PDBpipe.GMProperty objpropertyT.Name = "Title" objpropertyT.Value = "States" Dim dblMin As Double, dblMax As Double objRLE.GetDisplayScaleRange(dblMin, dblMax) objpropertyS.Name = "Subtitle" objpropertyS.Value = "Display Scale Range = " & dblMin & " to " & dblMax ' Set legend entry characteristics With objRLE .GeometryFieldName = "Geometry" .InputRecordset = objXFormPipe.OutputRecordset .Style = objstyle .PropertySet.Append(objpropertyT) .PropertySet.Append(objpropertyS) End With 'Set title font Dim objFont As stdole.StdFont objFont = CreateObject("StdFont") With objFont .Name = "Arial" .Size = 10 .Bold = True End With ' GMLegendView1.DefaultTitleFont = objFont GMLegendView1.DefaultTitleFontColor = RGB(0, 0, 100) ' Set subtitle font ``` -------------------------------- ### Initialize GeoMedia Components and Map View Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/4349.md Sets up the EventServer, MapView, and associated services. Ensure the correct GeoMedia libraries are referenced. ```vb Option Explicit On Imports PBasic = Intergraph.GeoMedia.PBasic Imports PClient = Intergraph.GeoMedia.PClient Imports PView = Intergraph.GeoMedia.PView Imports PCSS = Intergraph.GeoMedia.PCSS Imports MapviewLib = Intergraph.GeoMedia.MapviewLib Public Class Form1 Dim objEvSrv As PBasic.EventServer, objOrntPnt As PBasic.OrientedPointGeometry Dim objGeomEdit As PClient.GeometryEditService Dim objStyleService As New PView.StyleService Dim objstyle As PView.StyleDefinition Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load objEvSrv = CreateObject("Geomedia.EventServer") EventControl1.HesitationTime = 5 EventControl1.AddMapView(GMMapView1.Dispatch, objEvSrv) ' Set MapView parameters With GMMapView1 .CoordSystemsMgr = New PCSS.CoordSystemsMgr .CoordSystemsMgr.CoordSystem.BaseStorageType = PCSS.CSBaseStorageConstants.csbsGeographic .Legend = New PView.Legend .MousePointer = MapviewLib.CursorTypeConstants.gmmvctCrossHairZeroTolerance .BackgroundColor = RGB(255, 255, 255) End With ' Set MapView range GMMapView1.ZoomArea(-1.28, 0.75, 0, -1.41, 0.876, 0) GMMapView1.Refresh() ' Create Oriented Point object objOrntPnt = CreateObject("GeoMedia.OrientedPointGeometry") With objOrntPnt .Orientation.I = 1 .Orientation.J = 0 .Orientation.K = 0 End With MsgBox("Click left to place points. Click right to delete all points.") ' Create Geometry Edit Service object objGeomEdit = CreateObject("GeoMedia.GeometryEditService") objGeomEdit.MapView = GMMapView1.Dispatch ' Define Style object for Oriented Points objStyleService.GetStyle("Symbol Style", objstyle) With objstyle .StyleProperties(PView.StylePropertyConstants.gmgroPropertySymbolRendererName).Value = "FSM" .StyleProperties(PView.StylePropertyConstants.gmgroPropertyOverrideColor).Value = RGB(255, 0, 0) 'True .StyleProperties(PView.StylePropertyConstants.gmgroPropertySize).Value = 425 .StyleProperties(PView.StylePropertyConstants.gmgroPropertySource).Value = "C:\Program Files\GeoMedia Professional\Symbols\GISsym.fsm;Radar Dish" End With End Sub Private Sub EventControl1_ClickEvent(ByVal sender As System.Object, ByVal e As AxIntergraph.GeoMedia.GMEventControlLib._DGMEventControlEvents_ClickEvent) Handles EventControl1.ClickEvent If e.button = 1 Then objOrntPnt.Origin.X = e.worldX objOrntPnt.Origin.Y = e.worldY objOrntPnt.Origin.Z = e.worldZ ' Display points objGeomEdit.AppendGeometry(objOrntPnt, objstyle) Else ' Clear geometries from Geometry Edit Service If objGeomEdit.GeometryCount > 0 Then objGeomEdit.RemoveAllGeometries() End If End Sub End Class ``` -------------------------------- ### Get Positional Tolerance Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/4416.md Retrieves the current positional tolerance value. No setup or imports are required. ```vb Get PositionalTolerance Method Example Dim tol As Double tol = GetPositionalTolerance() ``` -------------------------------- ### MultiplyMatrices Method Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/4381.md Demonstrates initializing matrices, setting elements, multiplying them, and transforming a vector. Ensure matrices are properly initialized before multiplication. ```vb Dim m As Matrix Dim m1 As New Matrix Dim m2 As New Matrix Dim v As Vector m1.SetElement 0, 0, 7.3 m2.SetElement 1, 1, 3.7 Set m = MultiplyMatrices(m1, m2) SetMatrixToIdentity m ' v = 0, 1, 0 Set v = TransformVectorByMatrix(m, GetYAxis) ``` -------------------------------- ### Get or Set ICoordSystem GUID (C++) Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/markdown/P_Intergraph_CoordSystems_CoordSystem_Intergraph_CoordSystems_ICoordSystem_GUID.md This C++ snippet shows the declaration and implementation of the GUID property for the ICoordSystem interface using managed C++ syntax. It explicitly implements the interface members. ```cpp private: virtual property String^ GUID { String^ get () sealed = ICoordSystem::GUID::get; void set (String^ value) sealed = ICoordSystem::GUID::set; } ``` -------------------------------- ### Example Application Command XML File Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/installappcmd.md This XML file defines a single application command, including its ProgId, DLL name, description, and other properties required by the GeoMedia framework. ```xml GeoMediaCommand.PieCharts PieCharts.dll PieCharts -1 PieCharts 0 1 0 0 ``` -------------------------------- ### ComputeArcBy3Points Method Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/4367.md This example demonstrates how to use the ComputeArcBy3Points method to define an arc using start, on-arc, and end points. Ensure the 'Point' and 'Vector' types are properly defined and initialized. ```vb Dim radius As Double Dim greaterThanPi As Boolean Dim startPoint As New Point Dim endPoint As New Point Dim pointOnArc As New Point Dim normal As New Vector startPoint.X = 4# startPoint.Y = 3# startPoint.Z = 0# endPoint.X = -4# endPoint.Y = 3# endPoint.Z = 0# pointOnArc.X = 4# pointOnArc.Y = -3# pointOnArc.Z = 0# ' normal = 0, 0, -1 ' radius = 5 ' greaterThanPi = True ComputeArcBy3Points startPoint, pointOnArc, endPoint, normal, radius, greaterThanPi ``` -------------------------------- ### Creating and Using a Custom Filter Pipe Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/3848.md This example demonstrates creating an originating pipe, setting its table, creating a custom filter service with specific keys, and then applying it to a custom filter pipe. ```VB Dim objTempRS As GRecordset Dim objCustomFilterPipe As CustomFilterPipe Dim objCFSExample As CFSExample Dim objConnection As Connection Dim objOrigPipe As OriginatingPipe Set objConnection = gobjGeoApp.Document.Connections(1) objConnection.CreateOriginatingPipe objOrigPipe objOrigPipe.Table = "Counties" Set objCFSExample = CreateObject("GeoMediaCommand.CFSExample") objCFSExample.Keys = Array("1", "36", "56", "99") Set objCustomFilterPipe = CreateObject("GeoMedia.CustomFilterPipe") Set objCustomFilterPipe.InputRecordset = objOrigPipe.OutputRecordset Set objCustomFilterPipe.CustomFilterService = objCFSExample Set objTempRS = objCustomFilterPipe.OutputRecordset Set objCustomFilterPipe = Nothing objTempRS.MoveFirst ... ``` -------------------------------- ### GetValidTime Method Example in VB Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/Gtm_GetValidTime_Example.md This example shows how to call the GetValidTime method to retrieve the start date and an optional end date for a transaction. It also demonstrates how to format and print these dates to the debug output. ```vb Public Sub GTMExample() Dim vFromDate As Variant Dim untilMode As Long Dim vUntilDate As Variant On Error GoTo ExitSub Set m_DB = CreateObject("OracleOLTTRW.GDatabase") Call m_DB.OpenDatabase( "Oracle", , False, , "Scott/Tiger") Set m_TransExt = m_DB.GetExtension("Transaction") m_TransExt.GetValidTime vFromDate, untilMode, vUntilDate Debug.Print Format(vFromDate, "MM/DD/YYYY") & " " & Format(vFromDate, "HH:MM:SS AMPM") If (untilMode = gtmValidUntilSpecifiedDate) then Debug.Print Format(vUntilDate, "MM/DD/YYYY") & " " & Format(vUntilDate, "HH:MM:SS AMPM") End if Set m_TransExt = Nothing m_DB.Close Set m_DB = Nothing Exit Sub ExitSub: MsgBox Err.Description End Sub ``` -------------------------------- ### Example Schema Remodeler Parameter File Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/executing_schema_remodeler_from_the_command_line.md This is an example of a parameter file used to configure Schema Remodeler transformations when running from the command line. The 'TransFile' parameter is required. ```ini [SchemaRemodeler] TransFile=C:\\Program Files\\Schema\\Transformations\\MyTransformation.dwt LogFile=C:\\Program Files\\Schema\\Logs\\MyLog.log ActiveFeatureSets=MyFeatureSet1,MyFeatureSet2 ``` -------------------------------- ### Get Component End Points using GetComponentKeypointIndexOffset Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/4391.md Use this function to get the start and end points of each component within a geometry. It relies on helper functions like GetComponentCount, GetComponentKeypointIndexOffset, GetKeypointCount, GetComponent, and GetKeypointPosition. ```vb Public Function GetComponentEndPoints(geom As Object) As Points Dim i As Long Dim numComps As Long Dim numKeypoints As Long Dim offset As Long Dim pts As New Points numComps = GetComponentCount(geom) For i = 1 To numComps offset = GetComponentKeypointIndexOffset(geom, i) numKeypoints = GetKeypointCount(GetComponent(geom, i)) pts.Add GetKeypointPosition(geom, offset + 1) pts.Add GetKeypointPosition(geom, offset + numKeypoints) Next i Set GetComponentEndPoints = pts End Function ``` -------------------------------- ### Initialize GeoMedia Components Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/4430.md Sets up the MapView and LegendView components, including coordinate systems and background color. Also establishes a read-only connection to an Access database. ```vbnet Option Explicit On Imports PClient = Intergraph.GeoMedia.PClient Imports MapViewLib = Intergraph.GeoMedia.MapviewLib Imports PView = Intergraph.GeoMedia.PView Imports PDBpipe = Intergraph.GeoMedia.PDBPipe Imports PCSS = Intergraph.GeoMedia.PCSS Public Class Form1 Dim objConn As New PClient.Connection, objOPipe As PClient.OriginatingPipe Dim objRLE As PView.LegendEntry Dim objrenderer As Object Dim objstr As String, objStyle As PView.StyleDefinition Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Set MapView parameters With GMMapView1 .CoordSystemsMgr = New PCSS.CoordSystemsMgr .Legend = New PView.Legend .BackgroundColor = RGB(255, 255, 255) .MousePointer = MapViewLib.CursorTypeConstants.gmmvctNWArrow End With ' Set LegendView With GMLegendView1 .Top = 0 .Left = 0 .Width = 100 .Height = 75 End With GMLegendView1.Legend = GMMapView1.Legend ' Create connection With objConn .Location = "C:\Warehouses\USSampleData.mdb" .Mode = PClient.ConnectionConstants.gmcModeReadOnly .Type = "Access.GDatabase" .Name = "Connect1" .CoordSystemsMgr = GMMapView1.CoordSystemsMgr .Connect() End With ' Create recordset of States objConn.CreateOriginatingPipe(objOPipe) objOPipe.Table = "Interstates" objrenderer = CreateObject("Geomedia.FSMSymbolRenderer") objrenderer.Source = "C:\Program Files\GeoMedia Professional\Symbols\GISsym.fsm" TextBox1.Text = 500 ' Populate combo box with symbol names Dim strName As Object For Each strName In objrenderer.SymbolNames ComboBox1.Items.Add(strName) Next strName ComboBox1.SelectedIndex = 0 End Sub ``` -------------------------------- ### ExtractGeometry Method Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/4422.md This example demonstrates how to use the ExtractGeometry method to extract a geometry. It initializes a GeoMathService object, creates a PolylineGeometry, and then populates it with points. Finally, it calls ExtractGeometry with specified start and end points. ```vb Dim objGeoMathService As New GeoMathService Dim inGeom As New PolylineGeometry, outGeom As Object Dim startPt As New Point, endPt As New Point Dim pt As New Point, I As Integer For I = 1 To 10 pt.X = I pt.Y = I pt.Z = I inGeom.Points.Add pt Next startPt.X = 2.2 startPt.Y = 2.2 startPt.Z = 2.2 endPt.X = 5.6 endPt.Y = 5.6 endPt.Z = 5.6 Set pt = Nothing objGeoMathService.ExtractGeometry startPt, endPt, False, inGeom, outGeom Set inGeom = Nothing Set startPt = Nothing Set endPt = Nothing ``` -------------------------------- ### Initialize MFFence Object Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/mffence.md Demonstrates the creation of a new MFFence object. ```vb Dim opFence As MFFence Set opFence = New MFFence ``` -------------------------------- ### Get String Length with LENGTH Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/432277.md Use LENGTH to return the number of characters in an expression. Example: LENGTH[ParcelNumber]. ```expression LENGTH[ParcelNumber] ``` -------------------------------- ### Text File Connection Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/WH_ConnectInfo_Property.md Demonstrates how to configure the ConnectInfo property for a Text File connection, specifying data, format, and optional CSF file paths. ```VB.NET Dim objConn As New Connection With objConn .Type = "TextFile.GDatabase" .Name = "Text File Connection" .Location = "SomeName" .ConnectInfo = "DATA=D:\VBAutomation\TextFileDataserver\cities.txt;FORMAT=D:\VBAutomation\TextFileDataserver\cities.tfd;CSF=D:\VBAutomation\TextFileDataserver\geographic.csf" .Mode = gmcModeReadOnly .Connect End With ``` -------------------------------- ### GRule and GRuleClass Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/5969.md This code snippet shows how to establish a connection, retrieve feature classes, and iterate through rule classes to validate features. It includes examples of opening selections, getting features, and validating rules using GRule and GRuleClass objects. ```vb Dim objConnection As New Connection Dim objFeatureModel As GFeatureModel Dim objFeatureClass As GFeatureClass Dim objNewFeatureClass As GFeatureClass Dim objFeature As GFeature Dim objNewFeature As GFeature Dim objRecordset As GRecordset Dim objRuleClass As GRuleClass Dim objRule As GRule Dim I As Long Dim vReasons As Variant objConnection.ConnectionName = "SampleConnection" objConnection.Type = "Access.GDatabase" objConnection.ProxyType = "AFM.GDatabase" objConnection.Location = "X:\\SampleData\\GPW_Water.mdb" objConnection.Mode = gmcModeReadWrite objConnection.Connect Set objFeatureModel = objConnection.Database.GetExtension("FeatureModel") Set objFeatureClass = objFeatureModel.FeatureClasses("WATER_MAIN") ' FeatureClass OpenSelection method section. Set objRecordset = objFeatureClass.OpenSelection("") ' Feature Class GetFeature method section. objRecordset.MoveFirst Set objFeature = objFeatureClass.GetFeature(objRecordset) For I = 0 To objFeatureClass.RuleClasses.Count - 1 Set objRuleClass = objFeatureClass.RuleClasses(I) MsgBox "Rule Class Name is: " & objRuleClass.Name MsgBox "Rule Class Type is: " & objRuleClass.Type Set objNewFeatureClass = objRuleClass.Parent Set objRule = objRuleClass.GetRule(objFeature) Set objNewFeature = objRule.Parent MsgBox "Rule Class Name is: " & objRule.RuleClass.Name If objRule.Validate(vReasons) Then MsgBox "Valid Record" End If Next I ``` -------------------------------- ### Initialize GeoMedia Objects and Load Data Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/3823.md Sets up essential GeoMedia objects like Connection and ColorSchemes, and establishes a connection to an Access database. ```vbnet Option Explicit On Imports PView = Intergraph.GeoMedia.PView Imports PClient = Intergraph.GeoMedia.PClient Imports GDO = Intergraph.GeoMedia.GDO Imports MapViewLib = Intergraph.GeoMedia.MapviewLib Imports PDBPIpe = Intergraph.GeoMedia.PDBPipe Imports PCSS = Intergraph.GeoMedia.PCSS Imports AxMapViewLib = AxIntergraph.GeoMedia.MapviewLib Public Class Form1 Dim objConn As PClient.Connection Dim ThemLegendTitle As String Dim SubjectLegendTitle As String Public thematic_color_schemes As PView.ColorSchemes Public gCurrentColorSchemeIndex As Integer Dim nNextColor As Short Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load thematic_color_schemes = CreateObject("GeoMedia.colorschemes") ' Set the default color scheme index for the range ' legend entries that will be created. gCurrentColorSchemeIndex = 1 End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error GoTo Exit_Sub Err.Clear() Dim statesRS As GDO.GRecordset Dim iNumRanges As Short objConn = CreateObject("GeoMedia.Connection") With objConn .Location = "C:\Warehouses\USSampleData.mdb" .Mode = PClient.ConnectionConstants.gmcModeReadWrite .Type = "Access.GDatabase" .Connect() End With ``` -------------------------------- ### GTM Refresh Method Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/GTM_Refresh_Method_Example.md This example shows how to initialize the GTM database connection, get the Transaction extension, and then call the Refresh method on a specific record set. Ensure the database connection details and record set name are correct for your environment. ```VBScript Public Sub GTMExample() On Error GoTo ExitSub                 Set m_DB = CreateObject("OracleOLTTRW.GDatabase")                 Call m_DB.OpenDatabase( "Oracle", , False, , "Scott/Tiger")                 Set m_TransExt = m_DB.GetExtension("Transaction")                 Call m_TransExt.Refresh("RevSet1")                 Set m_TransExt = Nothing                 m_DB.Close                 Set m_DB = Nothing                 Exit Sub ExitSub:                 MsgBox Err.Description End Sub ``` -------------------------------- ### Initialize MFProfile Object Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/mfprofile.md Demonstrates the creation of a new MFProfile object. This is a foundational step before configuring its properties. ```VB Dim opProfile As MFProfile Set opProfile = New MFProfile ``` -------------------------------- ### LRSBeginMeasureFieldName Property Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown/TR_LRSBeginMeasureFieldName_Propert.md Gets or sets the name of a field in the LRSRecordset that contains the start length of the LRS feature. This property is required before OutputRecordset can be referenced. ```APIDOC ## LRSBeginMeasureFieldName Property ### Description The **LRSBeginMeasureFieldName** property gets or sets the name of a field in the LRSRecordset that contains the start length of the LRS feature. ### Syntax `object.LRSBeginMeasureFieldName` ### Elements #### object Required. The **LRSDynamicSegmentationPipe** object. ### DataType Read/Write String ### Remarks The **LRSBeginMeasureFieldName** property is required before the **OutputRecordset** can be referenced. This field can be of type short integer, long integer, float, or double number. The begin measure must be smaller than the end measure. When **LRSType** is *gmnLRSDuration*, there is no such requirement. ``` -------------------------------- ### InvertMatrix and TransformPointByMatrix Example Source: https://github.com/pszrajbe/gm-docs/blob/main/markdown_code_samples/4379.md Use InvertMatrix to get the inverse of a matrix and then use TransformPointByMatrix to transform a point. Ensure originalMatrix is defined before use. ```vb Dim invertedMatrix As Matrix Dim outPoint as Point Dim inPoint As New Point inPoint.x = 100.0 inPoint.Y = 100.0 inPoint.z = 0.0 Set invertedMatrix = InvertMatrix(originalMatrix) Set outPoint = TransformPointByMatrix(invertedMatrix, inPoint) ```