V7: MSBATCH

Discussion in 'Microstation' started by Guest, Jul 24, 2003.

  1. Guest

    Guest Guest

    Can anyone tell me the syntax/operators for MSBATCH to convert a folder of
    3D to 2D and also a folder of DGN to DWG?


    Thanks


    Ray
    _________________________________
    Coursemaster
    Emily Square
    Athy
    Co Kildare
    Ireland
    Tel: +353 (0)507 32888
    Fax: +353 (0)507 32893

    www.coursemaster.net
    __________________________
     
    Guest, Jul 24, 2003
    #1
  2. Guest

    Jon Summers Guest

    Ray ...
    @echo off
    rem Edited version of \MicroStation\msbatch.bat
    rem Converts 3D=>2D files using delivered cnvdgn.ma
    rem
    rem Command Line Syntax: msbatch cnvdgn <option1 option2 option3...>
    rem
    rem Example: (Convert 3D Design Files \dgn3d to 2D Files in \dgn2d)
    rem msbatch cnvdgn inname:\dgn3d\*.dgn outname:\dgn2d\
    rem
    rem Options:
    rem inname:<inputfilename> (May contain wildcards)
    rem outname:<outputfilename>
    rem view:<1-8>
    rem reference:<none|merge|maintain|convert>
    rem elevtype:<fixed|conzlo|conzhi|elemzlo|elemzhi> (2d => 3d only)
    rem elevation:<elevation value> (2d => 3d only)
    rem pauseScreen:<on|off>
    rem
    rem runwait ustation -wa%1 -i%2 -i%3 -i%4 -i%5 -i%6 -i%7 -i%8 -i%9
    rem
    runwait
    ustation -wacnvdgn -i"inname:L:\Maps\dgn3d\*.dgn" -i"outname:L:\Maps\dgn2d\"
     
    Jon Summers, Jul 24, 2003
    #2
  3. Inga Morozoff [Bentley], Jul 25, 2003
    #3
  4. 1 Create a folder titled "_Issue_Central" in the C drive
    2 Ensure that your PCF file locates all reference file paths and the
    location of DWGOUT
    3 decide if you want to Merge, Xref or ignore XREFFED autocad files
    4 Run the appropriate batch file

    eg

    msbatch dwgout input:c:\_issue_central\*.dgn outdwg createdwg
    macro:C:\cad\prefs\dwgdata\dwg-merge.bas

    Now dwg-merge.bas is a variation on a theme that is supplied with Ustn. The
    one BIG difference is that all cells are exported as unique cells
    if you dont do this they will all revert to a single size and scale (I
    strech my cells all the time)
    This is the content of my dwg-merge.bas

    '---------------------------------------------------------------------------
    --
    ' $RCSfile: dwgcontrol.bas,v $
    ' $Revision: 1.8 $
    ' $Date: 2000/08/18 11:03:45 $
    '---------------------------------------------------------------------------
    --
    '
    ' DWG/DXF Import/Export MicroStation BASIC Extensions Control file - program
    ' --refer to dwgBasic.readme for brief description of each method or
    property

    Sub Main

    ' Map orhpan cells to anonymous blocks under name *o:
    MbeBlockNameTable.addExportEntry "*o", ""
    ' Map fonts using true types if environment variable USE_TTF=1; otherwise
    ' map them using shape file names.
    Dim envVal as String
    if Val(MbeGetConfigVar ("USE_TTFF")) = 1 then
    MbeFontNameTable.addImportExportEntryFromFile "ttfont.tbl"
    else
    MbeFontNameTable.addImportExportEntryFromFile "dwgfont.tbl"
    end if

    'MbeFontNameTable.addImportExportEntry "italic", "TXT", 191, 1.0, 15.0
    'MbeFontNameTable.addImportExportEntry "heading", "ARIAL", 151



    ' Map hatch to pattern cells
    MbeHatchTable.addImportEntryFromFile "dwghatch1.tbl"
    MbeHatchTable.addExportEntryFromFile "dwghatch2.tbl"
    ' Map weights to weights
    MbeWeightWeightTable.addImportEntryFromFile "dwgwtwt1.tbl", "MS_DWGTABLES"
    MbeWeightWeightTable.addExportEntryFromFile "dwgwtwt2.tbl", "MS_DWGTABLES"

    MbeDWGImportSettings.polylineWidthAs = MBE_Linestyle ' MBE_Shape,
    ' MBE_Linestyle,
    ' MBE_Weight,
    ' MBE_None
    MbeDWGImportSettings.ignoreEmptyLayers = MBE_Off ' MBE_On, MBE_Off
    MbeDWGImportSettings.strokeSplines = MBE_Off ' MBE_On, MBE_Off
    MbeDWGImportSettings.dimCreate = MBE_CREATEDIMCELL ' MBE_CREATEDIMCELL,
    '
    MBE_CREATEDIMCOMBO,
    ' MBE_CREATEDIMONLY
    MbeDWGImportSettings.justifyText = MBE_On ' MBE_On, MBE_Off
    MbeDWGImportSettings.convertACIS = MBE_Default ' MBE_Ignore,
    MBE_Wireframe, MBE_Default
    MbeDWGImportSettings.defaultFont = 191 ' any valid MS font
    number
    MbeDWGImportSettings.createFileCell = MBE_Off 'MBE_On, MBE_Off
    MbeDWGImportSettings.ignoreXData = MBE_Off 'MBE_On, MBE_Off
    MbeDWGImportSettings.saveDGNSettings = MBE_Off 'MBE_On, MBE_Off

    MbeDWGExportSettings.ltScale = 0.5 ' any value > 0
    MbeDWGExportSettings.DXFPrecision = 6 ' any positive int
    MbeDWGExportSettings.refNameInLayer = MBE_Off ' MBE_On, MBE_Off
    MbeDWGExportSettings.reverseTagOrder = MBE_Off ' MBE_On, MBE_Off
    MbeDWGExportSettings.createDim = MBE_CREATEDIMCELL ' MBE_CREATEDIMCELL,

    MbeDWGExportSettings.convertNormalCell = MBE_Block_Unique

    MbeDWGExportSettings.ignoreBlankText = MBE_Off ' MBE_On, MBE_Off
    MbeDWGExportSettings.meshChordTolerance = 0.5 ' any value >= 0
    MbeDWGExportSettings.meshNormTolerance = 10.0 ' any value >= 0
    MbeDWGExportSettings.meshSizeTolerance = 0.0 ' any value >= 0
    MbeDWGExportSettings.splineSegs = 10 ' any positive int
    MbeDWGExportSettings.ACISVersion = MBE_ACIS300 'MBE_ACIS105
    'MBE_ACIS106
    'MBE_ACIS107
    'MBE_ACIS108
    'MBE_ACIS200
    'MBE_ACIS201
    'MBE_ACIS300
    'MBE_ACIS400
    MbeDWGExportSettings.levelsTurnedOff = MBE_LevelsOff_Ignore
    'MBE_LevelsOff_Freeze

    'MBE_LevelsOff_Thaw
    MbeDWGExportSettings.defaultFont = "txt.shx" ' any valid ACAD
    shape file name
    MbeDWGExportSettings.planarLineString = MBE_Polyline_2D '
    MBE_Polyline_3D,
    '
    MBE_Polyline_2D
    MbeDWGExportSettings.bsplineCurve = MBE_BCURVE_Parameters '
    MBE_BCURVE_Parameters,
    '
    MBE_BCURVE_FitPoints
    '
    MBE_BCURVE_Polyline
    MbeDWGExportSettings.dimensionStyle = "MSADIM"
    MbeDWGExportSettings.constructionClassLayer = "CONSTRUCTION_CLASS"
    MbeDWGExportSettings.patternClassLayer = "PATTERN_CLASS"
    ' If environment variable COPY_RASTER_FILES=1, then copy raster attachments
    ' to the exported DWG directory:
    if Val(MbeGetConfigVar ("COPY_RASTER_FILES")) = 1 then
    MbeDWGExportSettings.copyRasterFileTo = "*"
    end if
    MbeDWGExportSettings.convertRotatedViewToUcs = MBE_Off ' MBE_On,
    MBE_Off
    MbeDWGExportSettings.convertSpecialCharacters = MBE_On ' MBE_On,
    MBE_Off

    '---------------------------------------------------------------------------
    -----
    ' Following section is reserved for DWG applications to read/write GUI
    data.
    ' Thus this file is required to be on a local directory. This section is
    filled
    ' automatically by the GUI. Thus any manual editing here may be
    overridden by
    ' the DWG application's dialog boxes.
    '---------------------------------------------------------------------------
    -----
    'Begin Auto Edit
    MbeLevelTable.addImportEntryFromFile "m:\cad\prefs\dwgdata\dwglevel.tbl",
    "MASTERFILE"
    MbeWeightColor.addImportEntryFromFile "m:\cad\prefs\dwgdata\dwgwtco.tbl"
    MbeLineStyle.addImportEntryFromFile "m:\cad\prefs\dwgdata\dwgline.tbl"
    MbeColorTable.addImportEntryFromFile "m:\cad\prefs\dwgdata\dwgcolor.tbl"
    MbeCharTable.addImportEntryFromFile "m:\cad\prefs\dwgdata\dwgchar.tbl"
    MbeDWGImportSettings.xRefNestDepth = 10
    Dim point0 as MbePoint
    point0.x = 0#
    point0.y = 0#
    point0.z = 0#
    stat = MbeDWGImportSettings.setOrigin (point0)
    MbeDWGImportSettings.shiftGlobalOrigin = MBE_Off
    MbeDWGImportSettings.importFrozenLayers = MBE_Off
    MbeDWGImportSettings.mapWeightColor = MBE_Off
    MbeDWGImportSettings.displayElement = MBE_Off
    MbeDWGImportSettings.compressFractions = MBE_Off
    MbeDWGImportSettings.mapCharacters = MBE_Off
    MbeDWGImportSettings.useLineStyles = MBE_On
    MbeDWGImportSettings.resolveXRef = MBE_XRefAlways
    MbeDWGImportSettings.unitsMode = MBE_Master
    MbeDWGImportSettings.cellMode = MBE_Components
    MbeDWGImportSettings.colorMode = MBE_MstnPalette
    MbeDWGImportSettings.convertAttributes = MBE_Tags
    MbeLevelTable.addExportEntryFromFile "m:\cad\prefs\dwgdata\dwglevel.tbl",
    "MASTERFILE"
    MbeWeightColor.addExportEntryFromFile "m:\cad\prefs\dwgdata\dwgwtco.tbl"
    MbeLineStyle.addExportEntryFromFile "m:\cad\prefs\dwgdata\dwgline.tbl"
    MbeColorTable.addExportEntryFromFile "m:\cad\prefs\dwgdata\dwgcolor.tbl"
    MbeCharTable.addExportEntryFromFile "m:\cad\prefs\dwgdata\dwgchar.tbl"
    MbeWeightWidth.addExportEntryFromFile "m:\cad\prefs\dwgdata\dwgwtwd.tbl"
    MbeDWGExportSettings.refSourceView = 1
    MbeDWGExportSettings.masterSourceView = 1
    MbeDWGExportSettings.numberOfColors = 8
    MbeDWGExportSettings.seedDWGFile = ""
    MbeDWGExportSettings.overrideLevelNames = MBE_Off
    MbeDWGExportSettings.expandFractions = MBE_On
    MbeDWGExportSettings.useColorMapping = MBE_Off
    MbeDWGExportSettings.useCharMapping = MBE_Off
    MbeDWGExportSettings.convertWeight = MBE_WeightAs_ColorLabel
    MbeDWGExportSettings.defaultRefMode = MBE_MergeRef
    MbeDWGExportSettings.defaultClippedRefMode = MBE_MergeRef
    MbeDWGExportSettings.defaultSelfRefMode = MBE_MergeRef
    MbeDWGExportSettings.resolveRefAttachments = MBE_XRefAlways
    MbeDWGExportSettings.unitsMode = MBE_Master
    MbeDWGExportSettings.dwgVersion = MBE_DWGVER_13
    MbeDWGExportSettings.convertShapes = MBE_Shape_As_Polyline
    MbeDWGExportSettings.convertSmallFilledShapes = MBE_Shape_As_Solid
    MbeDWGExportSettings.convertSmallShapes = MBE_Shape_As_Polyline
    MbeDWGExportSettings.convertWideLineCode = MBE_LStyleOpt_PolyLine
    MbeDWGExportSettings.convertComplexLStyle = MBE_LStyleOpt_SingleLine
    MbeDWGExportSettings.dxfOutOption = MBE_DXFFile_Complete
    'End Auto Edit
    'Begin User Override
    '---------------------------------------------------------------------------
    -----
    ' Below example shows a way of centralized control of translation. All
    ' standard settings are placed in dwgstandard.bas which is, by default,
    ' located on $(_USTN_SITE)tables\dwg. This file can be shared over the
    ' network such that GUI settings on each terminal always get overridden
    ' by the the settings in that file.
    '---------------------------------------------------------------------------
    -----
    'MbeAddDwgBasicFile ("dwgstandard.bas")
    'End User Override
    end sub


    We have some special mappings, but you should be able to get the basics
     
    Anthony and Kirsty, Jul 29, 2003
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.