As an administrator for Bentley Map, you might prefer to create pre-defined connection parameters that can be used with the GDI CONNECT and GDI QUERY keyins. Doing so will enable you to place a library of keyins on a menu bar, custom tool box or function keys. This will streamline production workflows and eliminate errors from incorrectly defined search criteria.
Since GDI keyins do not provide the ability to specify a WHERE clause, the following content describes a workaround that may be of interest if simple search criteria are needed.
In this example, I have a named connection Nash where the property symbologies are defined in the Bentley Geospatial Administrator.
The Parcels feature has a Where Clause defined as (HEATING_FUEL = Electric)
This connection can be saved to an XML file by using Save As XML in the Connection Tools icon bar. While the content of the file is XML, the extension is ORAX.
Once the ORAX files are created, you can use them with the GDI CONNECT keyin:
GDI CONNECT FILE=FileName USER=UserName PASSWORD=Password.
GDI CONNECT FILE=C:\Data\Nash\ParcelsElectric.orax PASSWORD=nash
Note: The ORAX file stores the Oracle OpenParameters which includes the User, Host, Service and Port but not the Password.
Optionally the password can be added to the ORAX file. In the XML file add an element for the password using a text editor or XML editor.
To query the just the parcels with the Where Clause, the following keyin can be executed:
GDI QUERY FEATURE=Parcels VIEW 1
To eliminate a datapoint to accept the processing, append the POINT AB keyin.
GDI QUERY FEATURE=Parcels VIEW 1;POINT AB
Note: Care should be taken to ensure that the Apply Where Clause is enabled:
Alternate methods of setting up queries with search parameters might include:
- Set up and query views in the database rather than using searches in Bentley Map.
- Create a COM server that encapsulates some of the functionality available in the Bentley Map Interoperability API which is delivered as managed .NET assemblies. After encapsulating the Interoperability functionalities in a simple COM server, create a VBA application that uses the COM server to perform various Oracle Spatial Interoperability functions including the use of Where critera for searching and querying.
- Lastly, the use Live DGN might be helpful. Live DGN contains the connection parameters to the features defined in the connection. When the DGN file is opened, a password will be requested and the connection made. At that point all of the requested features will be queried into the DGN. Note that his is for Oracle Spatial only.
For more information regarding the GDI family of commands, please refer to: