Web de MiraMon

Command line parameters


MiraMon supports several parameters on the command line. They are useful to start MiraMon from the Command prompt(Console or old DOS box) or from other programs. They also allow writing BAT files that can automate linked processes for analysis or modeling print a series of maps or that can run a cyclic demo. It is also possible to use these parameters in any order, although some combinations do not make sense. Parameters must be separated by one or more blanks (spaces, tabs).

If your operating system version has a limited length for command lines, and your line is very long, it is possible to incorporate its content by copying the parameters into a text file and giving it to the application with an @ preceding the name of the file (for example "MiraD base_boscos.mdb @SentenciaSQL.txt" where SentenciaSQL.txt will contain a very long SQL statement preceded by /SQL =).

The most used parameter is the name of a MiraMon Map file. For example, it is possible to call:

MM32 C:\Maps\France\Roads.mmm

Remember that MiraMon allows relative addresses, UNC paths and long file names, so it is possible to write:

MM32 ..\..\..\Europe\DEM.mmm
MM32 \\SERVER\DataBases\Population\1995.mmm
MM32 C:\Maps\Baltic_sea\A_very_very_long_file_name.mmm
MM32 "C:\Maps\Baltic sea\A very very long file name.mmm"

It is also posible to open a compressed map (MMZX, MMZ) and all types of layers directly, for example:

MM32 \\SERVER\DataBases\Population\1995.mmz
MM32 \\SERVER\DataBases\Population\1995.pol
Note that long file names must be double quoted when they contain blanks. If a short file name is used, MiraMon will automatically define the long equivalent, which will be shown once the file is opened (for instance, if the name is "LITTLEP~1" it will be shown as "Little Prince"). If there is no extension, the ".mmm" extension is assumed.

Printing

/P Sends the specified file to the default printer/plotter. Example:

MM32 C:\Maps\France\Roads.mmm /P

Important: As this is intended for automatic (usually massive) printing, you will not have the chance to change the printer or plotter parameters. So, if you need some special configuration for the driver (portrait orientation, different paper size, screen/printer color matching, ) you must go to the Control Panel and set the new desired defaults before you start the printing process. Remember that in Windows it is possible to use "start /w" to indicate that each new printer process will not start until the last one is finished.

/P=xxxxxx Prints the composition saved in the map indicated as the xxxxxx file, using the printer/plotter configuration automatically. The xxxxxx file can be an EMF file, WMF file, BMP file or JPEG file (the xxxxxx file extension shows the type). Although the print is on a file, the composition uses the printer and paper characteristics automatically, as explained in the previous section.

/COLPRN=nnn Where nnn is the number of columns of the printed raster when it is made with a BMP file or JPEG file (print to a file, consult: /P=xxxxxx). This parameter defines the pixel size of the output image. The number of rows needed can be calculated depending on this parameter and the paper size. The number of rows can be cut back using "/FILPRN=".

/FILPRN=fff The paper size and the value of the parameter /COLPRN=nnn define the maximum number of rows the printed raster can have. It is possible to limit the number of rows in fff. This is useful when you want to print a square composition but you don't have the appropriate sized paper. In this case, it is possible to use a longer piece of paper placing the composition in the upper part of it and then cutting off the lower white part.

/QUALPRN=nnn Indicates the quality of the JPEG file obtained when the print is on a JPEG file. The default value is 75; it has to be between 0 and 100.

/JPG_PROGRESS Indicates that we want to generate a progressive JPEG when the print is on a JPEG file. If it is not indicated, the JPEG is non-progressive.

/DCMEMPRN Allows you to generate BMP or JPEG prints by default using the printer drivers instead of the graphic board drivers (which is done automatically).

/INV_RB=1 Is used when we want to interchange the R and B colors in the raster being printed, when the printing is on a BMP or a JPEG file. This is useful with certain printer drivers that interchange these colors by mistake.

Consult the JPEG printing example at the end of this section.

Open for editing

/DIGITALITZAR Opens the layer in the digitizing mode. If there is no layer, this parameter is ignored.

/EDITARATRIBUTS Opens the layer for editing. If there is no layer, this parameter is ignored.

Immediate openning

/SMM=nnn The layer is opened in the nnn MiraMon session. Using this parameter, the sessions selection box from the Director can be skipped (the question In which MiraMon session would you like to open the layer?). If there is no layer, this parameter is ignored.

/N_MIN_COLORS_PANTALLA=nnn This stops MiraMon from complaining when there are not enough colors in the graphic board. If this parameter is not defined, the complaint is shown if the number of colors is less than 32767. Appropriate values to avoid complaints in 256 and 16 color configurations are:

/N_MIN_COLORS_PANTALLA=256
/N_MIN_COLORS_PANTALLA=16

The minimum value accepted is 1 (without a screen: everything black, only one color), so there won't be any complaints.

Map presentations(batch)

/T=nnn Starts MiraMon and, after nnn seconds, closes it. It is useful for demos running cyclically from a BAT file. It skips the presentation box if it is the first MiraMon session and skips the session selection box from the Director in the following sessions. Example for 30 seconds:

MM32 C:\Maps\France\Roads.mmm /T=30

Metadata export

/h= /h = The name of the output file must be indicated. It supports a file name with the "*" asterisk, which will be replaced by the language code of the various languages available so that it will generate as many output files as documented languages. For example, for a base with metadata in two languages (Catalan and Spanish), the line item:

C:\mapes\IEFC\CatIEFCT.REL /h=CatIEFC_*.htm /DT=C:\mapes\IEFC\
It will generate two export files: CatIEFC_cat.htm and CatIEFC_spa.htm, in the layer directory and using the full template (default value in HTM exports if no /pl= is indicated).

/pl= Instead of indicating the complete path of the template, it is possible to use the literals "#PLANTILLA_RESUM_HTM#", "#PLANTILLA_COMPLETA_HTM #","#PLANTILLA_CORE_ISO_HTM#" and "#PLANTILLA_ISO19139_IDEC_XML#". This uses the templates of the MiraMon directory and has the advantage that it allows the same BAT to be used in directories where MiraMon is in a different directory (local, network, ). If the output file and the indicated template do not have equivalent extensions (HTM and XML or reverse) an error message appears and no output file is generated. If the indicated output file is in XML format and no template file to be used is indicated, the XML ISO 19139 ID template will be used. For example, for a base with metadata in two languages (Catalan and Spanish), the command line:

C:\mapes\IEFC\CatIEFCT.REL /h=CatIEFC_*.xml /DT=C:\mapes\IEFC\
will generate two export files: CatIEFC_cat.xml and CatIEFC_spa.xml, in the layer directory and will use the XML ISO 19139 IDEC export template.

/LOG= Typically in a BAT file we do not want the program to stop every time there is an informative or error message. Exports are likely to have messages as we may be informed that, for example, exporting is not possible, or that a date has been completed with "01", etc. To avoid these "interrupts", it is recommended to use the MiraMon /SAC general parameter along with the /LOG=Errors.log, which will cause the program to stop and all error messages be written in the file indicated at /LOG=.

Others

/IDIOMA= Sets the language of the program. MiraMon is currently available in three languages: Catalan, Spanish and English.

/DT=xxxxxx Sets the current working directory to xxxxxx (remember that the working directory is used to read the MiraMon.par file and other parameter files such as geodesy tables, etc). It is especially useful in network configurations. This supersedes the working directory specified by the operating system or by the text typed in the properties box of the icon of the program or the program shortcuts Start in parameter). It is possible to use UNC addresses as well as long file names, but in this case, you must use double quotation marks if you use blanks. Examples:

MM32 /DT=C:\USER\PETER
MM32 /DT=\\SERVER\RemoteSensing\MiraMon
MM32 /DT="C:\GIS USERS\PETER"

(The parameter /DT=xxxxxx is supported under all the MSA modules)

/MUT The application runs without displaying any information, even in case of an error. The screen is also not cleared.

/SIL This parameter avoids the applications issuing acoustic warnings, in "silent" mode (such as /MUT, but /SIL does show messages on the screen).

/XERRAIRE Allows you to show some messages, commonly unneeded, for debugging purposes.

/SAC The application never stops in case of any query, unless unavoidably data must be introduced by the user, which is very rare in the MSA. In these cases, remember that you can indicate to the Operating System the parameters that you would enter through a redirection operator. All requests for "Press any key" are skipped using /SAC. The name comes from the Catalan expression "anar a sac", which means "not stopping at anything".

/ERR The application runs without displaying any information, except in the event of possible error messages, which are shown. The screen is also not cleared.

/HWND_SMM This allows MM32 to respond with a HWND_BROADCAST. All the applications with the message "MM_A_EXE_HWND_SMM" will receive the message in which w_param is HWND of the MiraMon session and l_param is the MiraMon session number (which appears in the title bar between brackets and which can be forced when the map is opened with the parameter /SMM=). If you want an application to receive only the identification HWND_SMM, you should indicate the HWND of the application that has to receive the message: MM32 /HWND_SMM=23567. Therefore, we avoid all the applications receiving this information. It is important that the written value is a decimal value, not hexadecimal.

/STP The application stops (STOP) at the end of the program waiting for any key to be pressed. This is useful when the program is called from a Windows interface (as MiraMon does), a "Run" from the Program Manager or from the Windows "Start" menu.

For more information, see MSA control parameters.


Example of JPEG printing

To prepare automatically one JPEG from a MiraMon Map, one should print a JPEG from a command line parameter. The steps are:

  • Prepare the desired map for printing so that the default printer does not need to be changed.
  • Save the map.
  • Open the map with a double click and make sure that the composition is correct.

The syntax to use will be similar to:

MM32 Map.mmm /P=File.jpg /COLPRN=200 /FILPRN=200 /DCMEMPRN /QUALPRN=75
where:
  • Map.mmm is the map to convert to a JPEG file
  • /P=File.jpg is the JPEG file to be created
  • /COLPRN=200 is the number of columns of the JPEG raster
  • /FILPRN=200 is the number of rows of the JPEG raster (if not indicated, the number of rows corresponding to the entire paper are generated)
  • /DCMEMPRN means that the printer drivers will be used instead of the graphic board drivers
  • /QUALPRN=75 is the image quality (a way to express the JPEG compression ratio where 100 % indicates maximum quality and minimum compression)

To do this, you need disc space in the temporary directory in order to create a non-compressed image of requested size.