Configuring the Z\M output values for Shape files with Universal Translator via Command-Line

MapInfo Pro
Map Basic
 
The following is a map basic script that uses the Universal translator to convert a .tab file to a .shp file, the output .shp has both Z and M values disabled.

In the first stage of translation (generating a semantic mapping file), users need to specify a SHAPE_FILE_TYPE to make it either 2d, 2dm, or 3dm.
SHAPE_FILE_TYPE defaults to 3dm if not set.
An example of how one could generate this mapping file is provided below.

'Remarks: ShapeType sets SHP file type from variable in column SHP_TYPE
'3dm shapefile = Default if not set (3 Dimensional with measures)
'SHAPE_FILE_TYPE can also be "2dm" (2 Dimensional with measures) or "2d" (ArcView 3.x SHP file type for older shp format support

sExtension = "TAB" 'Sets Input extension to TAB format. If Input is MIF\MID, then use "MIF"
sBaseName = sInputFileName 'Sets BaseName to InputFileName - can be whatever you want.
sFullBaseName = sBaseName 'Sets Full Name to BaseName - again, can be whatever you want.

'Translation is two stage process:
'(1) Generate Semantic mapping\Control file
'(2) Run Mapping file through translator (fme.exe)

'To Generate the mapping file:
sMUTGenerate = "fme.exe Generate " + sInputFormat + " " + sDestFormat + " " + chr$(34) + gInputPath +
sInputFileName + ".TAB" + chr$(34) + " " + chr$(34) + gAppPath + sMappingFile + chr$(34) +
" --HOMOGENOUS_GEOMETRY " + sHomog_Geometry + " --SHAPE_FILE_TYPE " + ShapeType + " LOG_STANDARDOUT " + sLogFileOut +
" LOG_FILENAME " + Chr$(34) + gResultPath + chr$(92) + sLogFileName + chr$(34) + " LOG_APPEND " + sLogAppend
UPDATED:  January 31, 2020