Main menu:
A18.5 MMmacro Commands
Level of expertise required for this Chapter: Expert / Programmer; general Map Maker training
Following commands are available in MMmacro, partly undocumented, and can be used in a macro / module approach in MS Access or other databases, including Open Source DBMS platforms.
Most command names are self-explanatory.
For examples to apply MMmacro in MS Access, see the previous chapter (Annex 18.4).
Don't forget, you must have Map Maker loaded, before you run MMmacro.
Command |
Parameters |
Explanation / Remarks |
|
||
command=add layer, |
filename=C:\LUPMIS\Ghana\Ghana_roads, |
Add named layer |
command=add layer, |
filename=C:\LUPMIS\Ghana\Ghana_roads, |
Add named layer with labels displayed (or 'Object ID' for ids to be displayed or ‘=No label’ to turn labels off) (*) |
command=add layer, |
filename=C:\LUPMIS\Ghana\Ghana_roads.shp, |
Add non-DRA files, many formats supported |
command=add layer, |
filename=C:\LUPMIS\Ghana\Ghana_roads, |
Load with DBF file, similarly with MDB file (*) |
command=add layer, |
…(as above)… |
As above, |
command=add layer, |
…(as above)… |
As above, |
command=add layer, |
…(as above)… |
As above, |
command=move layer up, |
name=roads |
Move named layer up |
command=move layer down, |
name=roads |
Move named layer down |
command=hide layer, |
name=roads |
If layer already hidden, layer will be shown |
command=remove layer |
Remove all layers |
|
command=remove layer |
name= |
Remove all layers (same as above) |
command=remove layer |
name=roads |
Remove named layer (no path, no extension, only name) |
|
||
command=goto, |
x=645789, |
Center on given coordinates |
command=zoom, |
scale=5000 |
Zoom in/out to specified scale |
command=zoom and goto, |
x=645789, |
Combine two commands (centering and zooming) |
command=zoom relative, |
factor=3.5 |
|
command=goto id, |
layer=roads, |
Center on unit, specified by its id |
command=goto id, |
layer=roads, |
As above, |
command=goto id, |
layer=roads, |
Goto id and place a marker |
|
||
command=move layer to live layer, |
name=roads |
Move layer to live layer |
command=load live layer, |
filename=C:\LUPMIS\Ghana\Ghana_roads.dra |
Load live layer |
command=load live layer, |
filename=C:\LUPMIS\Ghana\Ghana_roads.dra, |
Load with MDB file (*) |
command=load live layer, |
filename=C:\LUPMIS\Ghana\Ghana_roads.dra, |
Load with DBF file (*) |
command=save live layer, |
filename=C:\LUPMIS\Ghana\Ghana_roads.dra, |
database= is optional, |
command=clear live layer |
(clears also markers) |
|
|
||
command=load project, |
filename=C:\LUPMIS\Kasoa\StructurePlan.geo |
Loads entire project, which can be treated externally (ASCII file) |
command=save project, |
filename=C:\LUPMIS\Kasoa\StructurePlan.geo |
|
|
||
command=print, |
template=C:\LUPMIS\Template_parcel.ptp, |
Print map with template, with dialogue box |
command=print, |
template=C:\LUPMIS\Template_parcel.ptp, |
Print map with template, without dialogue box |
command=print, |
filename=C:\LUPMIS\Temp_map.jpg, |
Print map to JPG or BMP or EMF file (*) |
command=print, |
filename=C:\LUPMIS\Temp_map.jpg, |
Same as above, but resolution defined |
command=save screen, |
filename=C:\LUPMIS\Temp_screen.jpg |
Print screen to JPG or BMP file, without dialogue (*) |
command=save screen, |
filename=C:\LUPMIS\Temp_screen.jpg, |
Same as above, but resolution defined |
|
||
command=zoom and goto, |
x=645789, |
Create a marker |
command=zoom and goto, |
x=645789, |
Create a marker with comma (*) |
command=save markers, |
filename=C:\LUPMIS\Temp\Markers.dra |
|
command=clear markers |
||
|
||
command=convert file, |
source=C:\LUPMIS\road_source.shp, |
Import from SHP format to DRA file |
command=convert file, |
source=C:\LUPMIS\road_source.dra, |
Export DRA file to SHP format |
command=convert file, |
source=C:\LUPMIS\road_source.dra, |
Export DRA file to MME format (MME format comprehensive and includes labels, but long) |
command=convert file, |
source=C:\LUPMIS\road_source.mme, |
Import from MME format to DRA file |
command=convert file, |
source=C:\LUPMIS\road_source.dra, |
Export DRA file to LOC format (LOC format short, but does not include labels) |
command=convert file, |
source=C:\LUPMIS\road_source.loc, |
Import from LOC format to DRA file (requires thorough testing, works reliably only if derived from earlier export from DRA file) |
command=convert file, |
source=C:\LUPMIS\road_source.xy, |
Import from XY format to DRA file (see Annex 16) |
command=convert file, |
source=C:\LUPMIS\road_source.dbf, |
Convert DBF file to CSV format (for easy import into databases) |
command=convert file, |
source=C:\LUPMIS\road_source.dra, |
Export data from DRA file to CSV (or DBF) file, (CAPTION stands for label), for metadata of features |
command=convert file, |
In addition to above: |
Same as above, but style names are included in the target database file (like classification lookup table) |
command=convert file, |
In addition to lines above: |
Same as above, but attributes are included: |
command=save legend, |
filename=C:\LUPMIS\legend.emf |
Saves legend as EMF file |
command=get calibration, |
source=C:\LUPMIS\road_source.jpg, |
Creates info (txt) file with calibration data of raster image file |
|
||
command=ids to labels, |
source=C:\LUPMIS\LocalPlan1.dra |
Sets ids equal to display labels |
command=ids to labels, |
source=C:\LUPMIS\LocalPlan1.dra, |
Sets ids equal to display labels in different DRA file |
command=labels to ids, |
source=C:\LUPMIS\LocalPlan1.dra |
Sets display labels equal to ids |
command=labels to ids, |
source=C:\LUPMIS\LocalPlan1.dra, |
Sets display labels equal to ids in different DRA file |
command=remove duplicate objects, |
source=C:\LUPMIS\LocalPlan1.dra |
|
command=inherit attributes, |
source=C:\LUPMIS\StructurePlan.dra, |
Inherits data attributes (here: styles only) from one DRA file to another (short form) |
command=inherit attributes, |
source=C:\LUPMIS\StructurePlan.dra, |
Inherits data attributes from one DRA file to another (full syntax) |
command=inherit attributes, |
-- same as above --, but last line: |
Inheritance (label) point is in source polygon |
|
||
C:\LUPMIS\batch.txt |
Batch, with complete command lines in ASCII batch file |
(*) There is a limit of the command line length, when calling from MS Access (approximately 270 characters), but not from many other sources, databases, platforms or batch processes.
- - - - -
For all above listed commands, Map Maker has to run in the background. The next Annex will explain, how to integrate these commands into your programmed application.
Note: Requirement: Map Maker version of 12 November 10 or later, and MMmacro.exe of 11 June 09 or later. See also official lt Technical Paper 8 of Map Maker.