Professional Documents
Culture Documents
《GeoMedia 二次开发手册》
《GeoMedia 二次开发手册》
Automation
GeoMedia GeoMedia
1
2
3
4
5
6
7
8
9
OLE
COM?
OLE
Excel
GeoMedia
GeoMedia
GeoMedia
GeoMedia
GeoMedia
GeoMedia
GeoMedia
Execl
GeoMedia
-1-
-2-
OLE
GeoMedia
GeoMedia
OLE
(Object Linking and Embedding)OLE
Word Excel
Excel OLE
OLE OLE
OLE OLE Excel
Visual Basic GeoMedia
(MapViews)(Pipes) Visual Basic Visual C++
OLE OLE COMOLE
GeoMedia
OLE
COM
GeoMedia
(COM) GeoMedia
COM
COM COM COM
COM
OLE OLE
COM COM Windows NT
COM Windows
Unix Macintosh COM
MSDN.Microsoft.com)Kraig Brockschmidt OLE 2
OLE
OLE OLE (Doument-centric)
(Application-centric)
OLE
OLE OLE
OLE
GeoMedia
OLE COM
IUnknown
COM
GeoMedia
OLE OLE OLE
-4-
OLE
VBVC
(Setting)/(Getting)
Type Library
Property
Method(Event)
click
Count Item
Count Item
For I = 1 To objCollention.Count
ObjX = objCollention.Item(I)
Next I
1 1 0
0 0 GeoMedia GDO 0
GeoMedia 1
_NewEnum For Each
Item
objCollection.Item(I)
objCollection(I)
Text
txtControl1.Text
txtControl1
-6-
Table - 1
With
Application.Document.Name = Automation Overview
Application.Document.Date = 7/12/97
Application.Document.Author = John Doe
With Application.Document
.Name = Automation Overview
-7-
.Date = 7/12/97
.Author = John Doe
End With
DimNewCreateObject
New
CreateObject Dim
(DLL)(EXE)
EXE EXE DLL
-8-
GeoMedia
UUIDGUIDCLSIDPROGID
GUID (IID)(CLSID)
IIDIID
IID
IID
CLSID CLSID CLSID
IID
ProgIDProgID
Windows ProgID CLSID API (_)
(.) ProgID GeoMedia CLSID GeoMedia
ProgID CreateObject
GeoMedia.Application GeoMedia.Connection GeoMedia.ColorSchemes ProgID
Access.GDatabase Access GDO ProgID
C++
HRESULT
IUnknownIDispatch
-9-
Excel
GeoMedia OLE
Intergraph Microsoft
- 10 -
Workbook
Worksheets Worksheet
Worksheet Range
Excel
Range
Application.Workbooks(1).Worksheets(1).Range
Excel Metacollections
2 Excel
- 11 -
Excel
Excel
Visual Basic
(Workbook)
GeoMedia
GeoMedia
GeoMedia GeoMedia
GeoMedia
GeoMedia
GeoMedia
GeoMedia
GeoMedia
GeoMedia /GeoMedia
- 12 -
GeoMedia
1GDO
GDO(Geographic Data Objects) OLE
GDO Intergraph
Visual Basic OLE Intergraph Open GIS
Consortium (OGC) GDO GDO
Microsoft DAO RDO Microsoft OLE
GIS
2Grecordset
GRecordset GRecordset
() ()GeoMedia GRecordset
GRecordset (cursor)
GRecordset GFields
Recordset GRecordset
GRecordset GRecordset
GRecordset
GRecordset MoveNext Bookmark
GeoMedia
GDO Term
Database
Other Synonyms
GDatabase
Database
Warehouse, server
GTableDef
Table
Feature Class
GField
Column
Attribute, field
GRecordset
Cursor
Recordset
Current row
- 13 -
3Legend
GeoMedia Legend
GeoMedia
feature
4Pipe
Pipe GeoMedia Pipe
GRecordset GeoMedia GRecordset
Pipe
Pipe GeoMedia GeoMedia
Pipe GRecordset
GRecordset GRecordset Pipe
GRecordset Pipe
5Coordinate System
GIS
GeoMedia
GeoMedia
Projected coordinate systems X,Y,H
X Y h
GeoMedia
6Feature Class
Feature class GeoMedia
feature class feature classes
7Feature
Feature
feature class feature feature class
- 14 -
GeoMedia
GeoMedia GeoMedia
GeoMedia
GeoMedia
Legend Style
GeoMedia Style
- 15 -
syy
ies Application.Document.Connections
Application.ActiveWindow.MapView.Legend.LegendEntries
Application.Document.Connections(1).ConnectionName
1Application
GeoMedia Application
Windows - Application
PreferenceSet - GeoMedia
UnitsOfMeasure - ()
Accelerator - ( F1)
Document
- 16 -
document
document
2Document
document
Legends legend
QueryFolder query classifications query classification
query
SelectedObjects
CoordSystemsMgr
SpatialFilters connection
PropertySet -
ColorSchemes
Windows MapWindow DataWindow .
DataWindow DataView DataView
3MapWindow
MapWindow MapViewNorthArrow ScaleBar
NorthArrow OLE
ScaleBar MapView (1
= 100 )
MapView
MapView Legend
CoordSystemsMgr
Legend MapView
LegendEntries
HighlightedObjects MapView
- 17 -
CoordSystemsMgr MapView
4Coordinate Systems
CoordSystemsMgr CoordSystem
GIS
CoordSystem
RefSpaceMgr
UnitFormatSpec
GeogSpace RefSpaceMgr
PaperSpace -
RefSpaceMgr
ProjSpace RefSpaceMgr
AltCoordSystemPaths
AltCoordSystemPath
AltCoordSystemPath CoordSystemsMgr
LeastSquares -
DatumTransformation -
- 18 -
5Legend
legend (Legend Entry)
(GRecordset)
RecordLegendEntry
RasterLegendEntry
RecordLegendEntry
RasterLegendEntry
RangeLegendEntry
UniqueValueLegendEntry
Style
Range
UniqueValue
- 19 -
RecordsetObject -
RecordObject -
GeometryObject -
RasterObject -
6GDO
GeoMedia GDO
GDO
GDatabase
GTableDef
GField
GIndex
GRecordset
GError
- 20 -
GFRMAdminExtension FRAMME
GFRMSeg FRAMME
ExtendedPropertySet OriginatingPipe
Name
Notification
Errors - GErrors
CoordSystem - GRecordset
- 21 -
GeometryCollection Geometry
PointGeometry
Origin X, Y, Z
Vector - I, J, K
Matrix - 4 x 4
OrientedPointGeometry
TextPointGeometry
LineGeometry
PolylineGeometry
RectangleGeometry
PolygonGeometry
BoundaryGeometry
Holes
RasterGeometry
ArcGeometry -
- 22 -
8Service Pipes
GeoMedia Application
Application Application
Application Controls GeoMedia
Services Pipes
Pipe Service Pipes
Service
- 23 -
AttributeFilterPipe SQL
BufferZonePipe
SpatialQueryPipe
CSSTransformPipe
OriginatingPipe
NameExtendedPropertySetNotification
SortPipe
SortKey SortPipe
CenterPointPipe -
EquijoinPipe -
GraphicsTextPipe -
MovePipe -
SchemaProjectPipe -
SpatialFilterPipe -
StatisticsService
GeometryDigitizeService
- 24 -
GeometryEditService
ServerTransService
RasterPropertiesService
MeasurementService
TableProperty MetadataService
FieldProperty MetadataService
SmartLocateService
AutoPanService -
OutputTableService -
SnapService -
- 25 -
- 26 -
- 27 -
GeoMedia GeoMedia
GeoMedia
- 28 -
3 GeoMedia
GeoMedia
GeoMedia GeoMedia
GeoMedia
GeoMedia
Tools > Customize (Menu
Bar)
Map
Data
None
HKEY_CURRENT_USER\Software\Intergraph\GeoMedia\02.00
- 29 -
(MenuBar/MenuItem, Accelerator,
Category/Command, ToolBar/ToolBarButton)
GeoMedia
GeoMedia
GeoMedia GeoMedia
C:\Program Files\GeoMedia\Program\Installusrcmd.exe
MyCommand.dll MyCommand.ini
dll ini ini
GeoMedia
dll
GeoMedia
PowerBuilder 5.0 dll GeoMedia
OLE PowerBuilder VB
Wrapper PowerBuilder
Application.CreateService GeoMedia
- 30 -
GeoMedia
GeoMedia GeoMedia
GeoMedia -0-2
-0-2
Application
Windows
ActiveWindow
Category(s)
Command(s)
MenuBar(s)
MenuItem(s)
Accelerator(s)
Document
DataWindow
MapWindow
MasterLegend
SelectedObjects
MapViewListeners
GMFeatureCombobox
GMFeatureListbox
ToolBar(s)
ToolBarButton(s)
GMFeatureComboboxInput
GMFeatureListbox Input
GMQueryStorage
GMTableStorage
GMLegendEntryOutput
GMDataWindowOutput
GeoMedia
GeoMedia
GeoMedia GeoMedia
(license) GeoMedia
Help > About MyApp... command.
Intergraph GeoMedia GeoMedia
(techtgm@ingr.com)
Object Bundles
GeoMedia
- 31 -
GeoMedia
GeoMedia GeoMedia
GeoMedia
GeoMedia GeoMedia
Visual Basic Excel
GeoMedia GeoMedia
Application.CreateService GeoMedia
CreateObject GeoMedia
GeoMedia
OLE/COM OLE
GUID, ProgID
- 32 -
Geomedia
GDO
GeoMedia
GeoMedia
1. GeoMedia
2. COM
3.
4. OLE
5. GeoMedia
6.
7. GeoMedia RecordLegendEntry
8.
9.
Dim objMD as Object
Set objMD = CreateObject(MService.MetadataService)
1. GeoMedia
2. GeoMedia :GDatabase GRecrdset GField MapView
Legend LegendEntries Style DataView
GDO
- 33 -
, GIS - GeoMedia
warehouse GDO MGE
MGE GDO Access Access GDO
Gdatabase OpenDatabase
Dim objAccessDbs As GDatabase
Set objAccessDbs = CreateObject(Access.GDatabase)
objAccessDbs.OpenDatabaseC:\wherever\myDB.mdb
CreateObject()
Dim objAccessDbs As New GDatabase
GeoMedia GDO
Access
Access
ArcInfo
AI
GW
MGE
MGE
FRAMME
FRAMME
MGSM
ArcView
AV
MGDM
MGDM
CAD Server
GCAD
Gdatabase GIS
Connection Connection
Connections Connection
MetadataService OriginatingPipe Connection
Connection Gdatabase
Dim objConnections As New Connections
Dim objConnection As Connection
Set objConnection
=objConnections.Add(c:\wherever\myDB.mdb)
With objConnection
.Type = "Access.GDatabase"
.Location = c:\wherever\myDB.mdb
.Connect
End With
Connection Connections
>, >,>
GeoMedia Program
Autoexec.bat path=
;C:\Program Files\GeoMedia\Program
2 OpenDatabase
gobjConnections modGlobals.bas
3 Type Location Connect
4 CloseDatabase frmDatabase
lstDatabases
5 Project Forms mfrmMain View>Code
6 MDIForm_Unload
gobjConnections gobjConnections
Disconnect Nothing
7
8 Mode
gmcModeReadOnly
MetadataService
OriginatingPipe fields
GRecordset
Grecordset Gdatabase
OpenRecordset OriginatingPipe
GeoMedia
GDatabase
GDatabase OpenRecordSet
Dim objRS As GRecordset
Set objRS = objAccessDbs.OpenRecordset (Parcels)
- 36 -
1.
GdbOpenDynaset
2.
GdbSnapshot
OriginatingPipe
OriginatingPipe
GeoMedia
- 37 -
MoveMoveFirstMoveLastMoveNext
MovePrevious BookMark
MoveNext
(Collection)
- 38 -
GeoMedia
WWW.ingr.com GeoMedia Team of GeoMedia
GField Type Type gdbSpatial
gdbGraphic SubType
Type / SubType
Description
GdbSpatial
GdbLinear
Geometry which is
comprised of a series of
points
GdbAreal
Geometry which is
comprised of a series of
points where the first and
last point are coincident.
The area may include one
or more holes.
GdbAnySpatial
GdbCoverage
Geometry describing an
image (raster data)
GdbPoint
Geometry defined by a
single point
- 39 -
GdbGraphic
GdbSpatial
Same as in gdbSpatial.
GdbLinear
Same as in gdbSpatial.
GdbAreal
Same as in gdbSpatial.
GdbAnySpatial
Same as in gdbSpatial.
GdbCoverage
Same as in gdbSpatial.
GdbGraphicsTe
xt
Geometry defined by a
point and a text string.
gdbPoint
Same as in gdbSpatial.
Geometry GeometryStorageService
Geometry
AnalyzeRecordset
1. VB C:\TGM\Labs\CustomApp\src\CustomApp.vbp.
Forms , frmSelectFeature, View > Code.
2. cboDatabases_Click, Table
lstFeatures .
GTableDef.Name
objMDSrvc
GetTables
vTableList vTableList Variant
UBound
LBound
- 40 -
3. Modules , modRecordset,
View > Code. CreateRecordset, OriginatingPipe
.
GetSelectFeatureInfo
objActiveConnection CreateOriginatingPipe
OriginatingPipe OriginatingPipe Table
GetSelectFeatureInfo . OriginatingPipe
OutputRecordset CreateRecordset (objRS).
CreateRecordset .
transformation
4. AnalyzeRecordset CreateRecordset
This is the sub procedure called when you select Analyze > Recordset
Information Recall that a subroutine calling statement does not require
parenthesis around the arguments. ObjRS is the argument to
CreateRecordset.
5.
frmRecordsetInfo txtFeature
txtCount
EOF BOF
8. Analyze > Recordset Information
Choose the Start command from the toolbar or Run menu. In your
application main window, main menubar, select File > Open. In the
Common File Open dialog, choose an Access database (e.g., US Sample
Data.mdb in the Warehouses directory). Select Analyze > Recordset
Information, and choose a feature to analyze.
- 41 -
MetadataService
OriginatingPipe fields
MapView
(Legend) MapView
MapView
Dim objLegend As New Legend
Set ocxMapView.Legend = objLegend
Set objLegend = Nothing
LegendEntries
RecordLegendEntry
GeoMedia
GeoMedia
ServerTransService CSSTransformPipe
CoordSystemsMgr
ocxMapView.CoordSystemsMgr =
CreateObject(CoordSystemsMgr)
- 42 -
ServerTransService
CreateSimpleTransFromCSMtoServer
CSSTransformPipe
LoadData
1. VB C:\TGM\Labs\CustomApp\src\CustomApp.vbp.
Forms frmMap View > Object
MapView
2. MapView Project > Components
Components Controls GMMapview OLE Custom
Control module OK
GMMapView
GMMapView
GMMapView
frmMap
- 43 -
5.
: mnuDisplayFeature_Click,
You are calling CreateRecordset from the previous lab.
, GetLegendEntry Given the
RecordLegendEntry returned from that function,
DisplayTheLegendEntry map view
9. ExtendedPropertySet
OriginatingPipe PrimaryGeometryFieldName.
Name legend entry
title
GetLegendEntry RecordLegendEntry
objExt Name legend entry Title.
Note: Similarly, the extended property GeometryType is used to get the
geometry type which is passed to the function GetStyleObject. This
function returns a style (based on the given geometry type) that is then
assigned as the Style property of the RecordLegendEntry. Style objects
will be covered in more detail in a later lab. This function will abstract that
for us during this lab.
10. As we have discussed, a transformation must be established between
each coordinate system used by your application. In the
- 44 -
Choose the Start command from the toolbar or Run menu. In your
application main window, main menubar, select File > Open. In the
Common File Open dialog, choose an Access database (e.g., US Sample
Data.mdb in the Warehouses directory). Select Window > Activate
Map. Select View > Add Feature, and choose a feature to display.
Notice that if you view the legend now (View > Legend), you will see the
newly created legend entry.
Summary: In Lab 4, you have placed a map view control on your form.
The paper scale of the coordinate system has been adjusted to control the
thickness of the lines in the display. The legend entry was created this
- 45 -
Style
AnyStyle gdbAnySpatial
GeoMedia
GeoMedia -
=1/72 0.0139inch
=0.353
gmsStyleUnitsPaper HIMETRIC 1
HIMETRIC=0.01
=35 HIMETRIC
- 46 -
300 GeoMedia 9
3 1/8
StyleUnits gmsStyleUnitsView
StyleUnits gmsStyleUnitsPaperAsNonscaling
gmsStyleUnitsPaper gmsStyleUnitsView
View Independent HIMETRIC
36 1/2inch
Style Object
Normally Applied To
Covered
Lab?
AreaStyle
Subtype = gdbAreal
Yes
AnyStyle
Subtype = gdbAnySpatial
Yes
BitmapStyle
Subtype = gdbPoint
No
HandleStyle
Not applicable
No
LinearStyle
Subtype = gdbLinear
No
SymbolFontStyle
Subtype = gdbPoint
Yes
TextStyle
Subtype = gdbGraphicsText
Yes
PointSymbolStyle
Subtype = gdbPoint
No
PatternedLinearStyle
Subtype = gdbLinear
No
PatternedAreaStyle
Subtype = gdbAreal
No
in
GeoMedia
NorthArrowScaleBar MapViewID
MapView
In this lab, we will add the custom controls to our map view. We will set the necessary properties
in the form load operation and turn on their display.
- 47 -
Select frmMap from the Forms list, and select View > Object.
Select frmMap from the Forms list, and select View > Code.
8. Select the Form object and Load from the procedure list. Add logic to
assign the Dispatch pointer of the map view control to the MapViewID
property of the north arrow.
Both the GMNorthArrow1 and ocxMapView are properties of frmMap.
The code skeleton includes logic for adjusting the controls position within
the map view control.
9.
- 48 -
Select frmMap from the Forms list, and select View > Object.
Select frmMap from the Forms list, and select View > Code.
8. Select the Form object and Load from the procedure list. Add logic to
assign the Dispatch pointer of the map view control to the MapViewID
property of the scale bar.
Both the GMScaleBar1 and ocxMapView are properties of frmMap.
The code skeleton includes logic for adjusting the controls position within
the map view control.
9.
Open a database. Select Window > Activate Map. Select File > Open
to open a database. Select View > Add Feature and display the States
- 49 -
feature. The ScaleBar should appear at the location you placed the
control. The area surrounding the scale bar should be the same color as
the map view. The ScaleBar will adjust to the scale of the data.
Summary: In Lab 6, Section B, you placed the control on the form and
established the communication through the map view. Many other
properties can be configured for the ScaleBar.
GeoMedia PageSetup
PreferenceSet
UnitsOfMeasure Print
Postscript
Postscript
map Window Page SetupPrinterPropertiesDocument
Properties OptionsEncapsulated Postscript File
GeoMedia GeoMedia
GeoMedia Imagineer
<![endif]>
OPTIONAL Lab 7: Printing
For this lab, we will implement the Map > File > Print command for the map view.
Section A: PageSetup
1.
Select frmMap from the Forms list, and select View > Code.
- 50 -
3.
4.
Open a database. Select Window > Activate Map. Select View > Add
Feature, select a feature, and select OK. Select File > Print. The
PageSetup dialog should appear. Select OK or Cancel.
Summary: In Lab 7, Section A, you created the preference set object and
UnitsOfMeasure objects. These are used by the page setup to determine
size of the areas. You configured the command to display this dialog.
Section B: Print
1.
2.
Select frmMap from the Forms list, and select View > Code.
3.
4.
Add logic to call the Print method on the print command object.
- 51 -
used if the help button is selected on one of the dialogs. Any value may
be used.
5. Save the project, and compile the executable by selecting File >
Make customapp.exe
6.
Open a database. Select Window > Activate Map. Select View > Add
Feature, select a feature, and select OK. Select File > Print. The
PageSetup dialog should appear. Select OK or Cancel. The Print dialog
should appear. Select OK or Cancel. If a printer is available, review your
results.
Summary: In Lab 7, Section B, you initiated the print dialog. Again, the
map view dispatch is used to establish the location of the map view. This
component actually drives the print operation.
GeoMedia GeoMedia
feature class
query
GeoMedia
GeoMedia
OpenRecordset
OriginatingPipe SpatialQueryPipe
vSpatialFilter = objHiwayTbl.GFields(Geometry).Value
objOP.SpatialFilter = vSpatialFilter
objOP.GeometryFieldName = Geometry
Dim objRS As GRecordset
Set objRS = objOP.OutputRecordset
SpatialQueryPipe
GeoMedia
GeoMedia
Spatial Query
Pipe
gmsqWithinDistance
- 53 -
gmsqMeet
gmsqOverlap
- 54 -
gmsqContains
gmsqContainedBy
gmsqEntirelyContains gmsqContains
gmsqEntirelyContainedBy gmsqContainedBy
gmsqSpatiallyEqual
- 55 -
gmsqTouches
Property
Description
DerivedGeometryFieldName
Distance
Applicable
only
SpatialOperator
gmsqWithinDistance.
ErrorCount
FirstGeometryFieldName
FirstRecordset
when
the
is
FirstRecordset.
OutputRecordset
ReferenceFirstRecordset
ReferenceSecondRecordset
SecondGeometryFieldName
SecondRecordset
SpatialOperator
This section of the lab will add the logic to display the list of linear measurements in the
combobox.
- 57 -
3.
Open a database. Select Window > Activate Map. Select Analyze >
Spatial Query. Select the within distance operator to test the display of
the list. Cancel the dialog, as the code has not been finished yet to
process OK.
Summary: In Lab 8, Section A, you retrieved the linear measurement
types from the UnitsOfMeasure object and displayed them in the
combobox control. You tested the processing of the command to display
the special within distance controls when that spatial operator is selected.
This section of the lab will create the input recordsets, set up the pipe, and retrieve the output
recordset.
- 58 -
Add logic to retrieve the recordsets associated with the two selections.
- 59 -
Add code identical to that which you did in Lab 4 using the
GetLegendEntry and DisplayTheLegendEntry functions. Only create a
legend entry if there are rows in the recordset. This can be determined by
testing the EOF and BOF properties. The input to the GetLegendEntry
function is objSQRS while the output should be stored in objLE.
9. Save the project, and compile the executable from File > Make
customapp.exe.
10. Test the application.
Open a database. Select Window > Activate Map. Select Analyze >
Spatial Query. Select two features and an operator. Select OK.
Processing should complete although you wont see any displayed data.
Summary: In Lab 8, Section B, you created the OriginatingPipe recordsets for the selected
features. You compared coordinate systems through the CoordSystemGUID values. If they
were not the same, you transformed one recordset to the other coordinate system. If the
operator was Within Distance, you converted the input value to the units of the data. You
reused your existing functions for creating and displaying a legend entry.
BufferzonePipe GeoMedia
BufferzonePipe
OutputRecordset
Buffer Zone
BufferzonePipe
Property
Description
BufferType
:
gmbtAreaInside,
gmbtLinearButtEnd,
- 60 -
gmbtAreaOutside,
gmbtLinearRoundEnd,
gmbtLinearSquareEnd,
gmbtPoint,
gmbtPointRinged, gmbtPointStacked.
DistanceType
:
gmbdConstant, gmbdVariable.
ErrorCount
InputDistance
DistanceType
DistanceType
InputGeometryFieldName
InputRecordset
Merge
OutputGeometryFieldName
OutputRecordset
Tolerance
0.01.
1.
Select frmBuffer.frm from the Forms list, and select View Form.
- 61 -
The Buffer Zone form will appear. All of the controls have been placed on
the form already. You will add code to the procedure for the OK button to
perform the actual bufferzone computation.
3.
The code window will appear with the focus set to the btnOK_Click
function.
4.
This will vary based on the geometry type of the feature that is to be
buffered. Use the Object Browser to find the values for the
BufferZoneTypeConstants.
8.
Set the geometry field properties for both the input and output tables.
The input geometry field name has already been retrieved and stored in
strInputGeometryFieldName.
9.
- 62 -
SmartLocateService
- 63 -
LocatedObjectsCollection
HighlightedObjects
SmartLocateService
Locate
SmartLocateService LocatedObjectsCollection
Property/Method
Description
FenceMode
locFenceInside or locFenceOverlap.
PixelTolerance
Locate
ocxMapVw1.Dispatch, objEvServer
- 64 -
RemoveMapView EventServer
LocatedObjectsCollection
SmartLocateService
HighlightedObjects
highlight set or select set.
LocatedObjectsCollection
ocxMapVw.HighlightedObjects.SetDisplayColor GB(255,0,0)
ocxMapVw.HighlightedObjects.Add objLocObjects.Item(1)
Property/Method
Description
Count
SetDisplayColor
Add
Clear
GetRange
IsMember
Remove
This lab selects a feature or features in the map view, and then iterates through the highlighted
objects. You will access the recordset corresponding to the selected feature, and finally display the
- 65 -
1.
The code window will appear with the focus set to the
mnuAnalyzeAttributes_Click function.
4.
Set the status bar prompt to ask the end user to select a feature.
Remember to set the bookmark after you have assigned the recordset
from the LocatedObjectsCollection.
10. Iterate through the recordsets fields, and display the fields and values
in the form.
Scroll to the DisplayReviewDialog function. This is listed in the
(General) section. Generate a string with the field name and field value
for each field in the recordset. Add the string to the listbox on the form.
You should always check database values for Null before manipulating
them.
11. Add the code to display the form.
This action is supported by the Show method. The argument value of one
(1) indicates that the dialog is modal.
12. When the user selects the OK button, end the command.
Scroll back to the ocxEventControl_Click function. Remember to execute
the RemoveMapView method on the EventControl and then clear the
two collections. In the Wrapup section of this function release the
SmartLocateService, LocatedObjectsCollection, and EventServer
objects The variables you will reference are ocxEventControl,
ocxMapView, and objLocatedObjects.
13. Save and compile the application. Test the application.
Open a map view. Add a feature to the map view. Select the Analyze >
Attribute command. Select a feature, and you should see the review
form display with a database record that corresponds to the selected
feature.
Summary: In Lab 10, you placed the event control and established the
communication between the view and the control with the event server.
The SmartLocateService and the LocatedObjectsCollection are
instantiated to perform the Locate operation. The feature that is found
- 67 -
first is highlighted and its field names and values are displayed in the
dialog.
OriginatingPipe
Mode
Key Sequence
Result
Cell
Select a cell
- 68 -
Column
Row
Up / Down Arrow
Home
Shift Home
End
Shift End
Select
or
unselect
discontiguous columns
Select
or
unselect
discontiguous rows
Up / Down Arrow
Page Up / Down
- 69 -
Home / End
Event
Description
DeleteRows
GotFocus
LostFocus
NewCell
SelectCell
SelectColumn
SelectRow
UpdateCell
- 70 -
This lab covers the basic operation of the data view. You will place the control on your form and
allow the user to select a table to display.
Open a database. Select Window > Activate Data. Select a feature and
select OK. The form should appear with the data view as a white square.
Test resizing the form and notice the adjustment of the data view control.
- 71 -
Summary: In Lab 11, Section A, you placed the data view control,
adjusted its position, and added the logic to automatically resize it.
In this section of the lab, you will display a recordset in the data view.
Use the SetRecordset method on the control. The inputs to this function
are a database pointer, a caption, and, a recordset. The database pointer
need not be initialized. Use objDB which is defined in the function. Use
the name of the table as the caption. The name of the table can be found
by looking at the SourceTable property on the first field of the recordset.
Finally, the recordset, objRS is returned from the CreateRecordset
function.
3.
Open a database. Select Window > Activate Data. Select a feature and
select OK. The form should appear displaying the contents of the selected
feature.
Summary: In Lab 11, Section B, you created a recordset and associated
it with the data view.
In this section of the lab, you will change the recordset displayed in the data view.
Add logic to change the recordset associated with the data view.
Again, use the SetRecordset method on the control. The inputs are the
same as in the previous section of the exercise.
- 72 -
3. Select frmMap in the Project Window, and select View Code. Select
the mnuWindowData object, and select the Click procedure.
4. Add logic to make sure a recordset is active before showing the data
window from the active map view.
Again, this is the same logic as implemented in step 2.
5.
Open a database. Select Window > Activate Data. Select a feature and
select OK. The form should appear displaying the contents of the selected
feature. Select Tools > Change Contents. Select a feature and select
OK. The contents of the view should change to reflect the new feature
class.
Summary: In Lab 11, Section C, you again used the SetRecordset method to implement the
Change Contents command.
A:
B:
C:
This lab involves a common operation on tabular data sorting. The GeoMedia product supports
a single key sort operation. The SortPipe object is used to perform the sorting. The pipe object
actually supports a multiple key sort.
Select modSort.bas from the project window, and select View Code.
- 73 -
Open a database and display the data window. Select Tools > Sort.
Verify that the list of attributes is populated on the left.
Summary: In Lab 12, Section A, you reviewed the logic for populating the
form with the recordset fields available for sorting.
4. Add logic to remove the fields selected in the right list from the
collection of keys.
- 74 -
Open the database, activate the data window, and select Tools > Sort.
Test your work by adding several attributes and clearing the sort list.
Summary: In Lab 12, Section B, you created a SortKey for each selected
field and set the SortAscendingFlag appropriately. You added logic to
clear the collection of keys in case the user selected them in the wrong
order.
Finally, you will see the sorted recordset. The sort is controlled by the order that the keys are
added to the collection. For instance, if you want an alphabetic list of employees by their last
name, you would first add the LastName field to the collection. Follow this by FirstName and
MiddleInitial to get a list sorted first by last name. Within the same last name, the list is sorted by
first names. Finally, when both last and first name are the same, the data is ordered by the middle
initial.
Open the database, activate the data window, and select Tools > Sort.
Test your work by adding several attributes and selecting OK.
Summary: In Lab 12, Section C, you established the recordset associated
with data view as the InputRecordset for the SortPipe. You then
retrieved the OutputRecordset from the pipe and assigned it to the data
view.
GeoMedia
GeoMedia
GeoMedia
GeoMedia
application
GeoMedia
geoworkspace
- 76 -
GeoMedia
GeoMedia
GeoMedia
GDO
GeoMedia
originating pipe
Connection.BroadcastDatabase
GDO GDO refresh
requery
GeoMedia
- 77 -
Intergraph GeoMedia
DLL,TypeLib,OCX GeoMedia
uninstall
Intergraph GeoMedia
DLL GeoMedia
GeoMedia
GeoMedia
1 GDO
2
3 MapView
4
5
6
7 data view
GeoMedia
Connections, Connection
GDatabase
GRecordset, OriginatingPipe
GFields, GField
GMMapView
Legend
LegendEntries
- 78 -
RecordLegendEntry
Styles
GMNorthArrow
GMScaleBar
MetadataService
SpatialQueryPipe
BufferZonePipe
SmartLocateService
EventServer and
EventControl
LocatedObjectsCollecti
on
HighlightedObjects
GMDataView
SortPipe
- 79 -