10-27-2017 03:44 AM
I want to create a custom command in Geomedia 14, which can provide me information about the object I clicked on in the MapWindow.
I can get the object itself with the LocatedObjectsCollection, but how can I get some information about this object, like which FeatureClass it is in, or what are its attributes, etc.
Solved! Go to Solution.
10-27-2017 05:47 AM
the LocatedObjectsCollection can hold an object of the following type: RecordObject, GeometryObject, RecordsetObject and RasterObject. See the GeoMedia Object Reference help for details on each of these objects type. Basically, each object has a property named Recordset and Bookmark, which indicates the position of the current record in the Recordset. To get the connection of the given recordset is not easy, since a recordset displayed in a map can be created from several sources based on one or more connections. So this is basically viable to find only in the case when the recordset is based on an OriginatingPipe. You can find that by querying the GRecordset.GetExtension("OriginatingPipe") property in a try...catch block. If it throws an exception, then the recordset is not based on OriginatingPipe. If there is no exception, the property returns the originating pipe which was used to create the recordset. In this case, you have access to the connection, attribute filter and geometry filter for the given recordset.
You may also consider replacing the built in Properties dialog - the one shown if you insert, edit or double click a feature in the map. For this, look at Controls Automation > Properties Automation > GMProperties in the GM Object Reference help.