Bentley Systems

DWG- and DXF-Related Configuration Variables

MicroStation provides various configuration variables—such as MS_ACADDIR for locating AutoCAD support files, MS_BLOCKLIST for managing DWG/DXF cell insertions, MS_DWG_BACKUP for backup file directories, and others controlling unit formats, font paths, command prefixes, and annotation scale behaviors—that collectively govern how DWG and DXF files are opened, edited, referenced, and saved within the software.

MicroStation includes configuration variables to help open, edit, and reference AutoCAD DWG data. The following configuration variables affect MicroStation's DWG operations:


Configuration Variables for DWG and DXF Operations

  • MS_ACADDIR: Defines the directory containing AutoCAD. Used to find DWG support files, such as fonts. When you first load the product, it reads the registry, determines whether AutoCAD or AutoCAD LT is installed, and if present, sets this variable.

  • MS_BLOCKLIST: Defines the list of DWG and DXF files available for insertion as cells. You can use this variable when you click on Display All Cells in MS_CELLLIST icon in the Cell Library dialog.

  • MS_DWG_BACKUP: Defines the directory for DWG backup (.bak) files. If not set, backup files are placed in the same directory as the DWG file.

  • MS_DWG_COMMANDPREFIX: Defines a character or string of characters that can be used as a shortcut to the AutoCAD key-in commands.

  • MS_DWG_CREATE_SPACE_FROM_EDF: If set to 1, any empty data field remains as a space.

  • MS_DWG_FEETUNIT_AS_ARCHENG: If set, when a DGN file with Working Units set to Feet-Inches, Format set to Master Units, and Units on the Save As DWG/DXF Options dialog set to Master Units, the resulting DWG file has Engineering or Architectural units in AutoCAD. If not set, the units are Decimal or Fractional.

  • MS_DWG_FIELD_2005FORMATTING: If defined and set to 1, the product only generates field information that AutoCAD 2005 supports.

  • MS_DWG_LSTYLE_FONTPATH: Determines the location of the font file.

  • MS_DWG_LSTYLE_FONTNAME: Determines the name of the font file, and therefore, the name of the font.

  • MS_DWG_MATCHORIENTATION_TOLAYOUT:

    • If value is set to 0 or not set, the option of "match orientation to layout" on an annotation scale element is ignored. The element will be View Dependent (responds to view rotation).
    • If value is set to 1, an annotation scale element with "match orientation to layout" turned on will be set to View Independent (does not respond to view rotation). When a model is rotated, the element stays displayed horizontally. This applies to all models.
    • If value is set to 2, an annotation scale element will be set to View Independent under these conditions:
      • "match orientation to layout" is turned on
      • the active model is a sheet model
      • the default model is not rotated The result is that if the active model is a layout in a DWG file and the model space is NOT rotated, the file will open and display correctly across all models. However, a DWG file that does not meet these conditions may not be displayed correctly in sheet models.
  • MS_DWG_MAX_ORPHANTAGS_PERSET: Sets the maximum number of tags per tagset for "orphan tags." An orphan tag is an attribute definition that is never instantiated in a block as it should in a DWG file. When opening a DWG file, all such dangling attribute definitions are collected into a tagset. For better performance, a tagset should be limited to a manageable size. The default size is 100 per tagset.

  • MS_DWG_OEBREP_AS_BREP: If set to 1, custom objects derived from Autodesk ShapeManager (ASM) entities (such as 3DSOLID, SURFACE, BODY, and REGION) will be treated as ASM entities. These custom objects will be converted to Parasolid elements, just like the standard ASM entities. If not set (the default), the elements created on file open are controlled by the options under Custom/Proxy Objects in the Advanced section of the DWG Open Options dialog. CADWorx and Pipe Designer object enablers are impacted by this variable.

  • MS_DWG_PGPFILE: Points to a PGP file that contains shortcuts, or aliases, for AutoCAD commands.

  • MS_DWG_PRE2004_COLOR_TABLE: Sets the color table for DWG files. In version 2004, AutoCAD began displaying indexed colors with slightly different (generally lighter) colors. The product also uses these new colors unless this variable is set.

  • MS_DWGAUTOSAVE: If set to a positive number, specifies the number of seconds after the movement of the cursor stops in the DWG or DXF file that auto-save occurs. When this time elapses, an Alert window appears that asks whether the changes should be saved. If set to zero, no auto-save is done while the file is open. The file is automatically saved on exit or when switching to a different file.

  • MS_DWGAUTOSAVE_NODIALOG: If set to a positive number, specifies the number of seconds after the movement of the cursor stops in the DWG or DXF file that auto-save occurs. The Alert window is skipped and the file change is automatically saved.

  • MS_DWGDATA: Points to the directory where the following files are stored:

    • DwgSettings.rsc — resource file containing all of the DWG settings
    • Files (*.dws) containing saved settings for opening and saving DWG/DXF files
    • DwgDisplayColors.tbl (optional) — color table for display
    • DwgPlotColors.tbl (optional) — color table for plotting
  • MS_DWGFONTPATH: Defines the path to AutoCAD *.SHX fonts if AutoCAD is not installed. By default, the product first uses the value of MS_ACADDIR to find AutoCAD support files. If unavailable, it uses individual variables such as MS_DWGFONTPATH.

  • MS_DWGOMITUNIQUEEXTENSION: If more than one file with the same name is present in the same directory, appends the extension to the output filename when saving the file. For example, if the directory contains both sample.s01 and sample.s02, then the extension is included in the output filenames (sample_s01.dgn and sample_s02.dgn). If the directory does not include any files with duplicate names, then the extensions are not included in the output names. For example, if the directory contains only file sample.s02, this file is saved to sample.dwg.

  • MS_DWGPATFILE: Defines the full path file name that contains AutoCAD pattern definitions.

  • MS_DWGREF_ALLOWMASTERCOLORS: Defines how the product uses color tables for DWG or DXF files attached as references.

    • If set to 1, the color tables for DWG or DXF references are handled as they are for DGN references: controlled by the Use Color Table setting in the Preferences dialog Reference Category. When Use Color Table is on, elements in each reference are displayed using the reference's color table. When off, elements are displayed using the active design file's color table.
    • If not set, DWG or DXF references are always displayed using the reference file's color table. The Use Color Table setting has no effect.
  • MS_DWGSEED: Defines the DWG seed file used when opening DWG files.

  • MS_DWGSEED_OVERRIDE: Determines whether a user can modify the DWG Seed File setting on the Save As DWG/DXF Options dialog.

    • Not set or set to 0: the first time the dialog opens, the default DWG seed file is set by MS_DWGSEED. You can choose a different seed file.
    • Set to 1: you can only use the DWG seed file identified by MS_DWGSEED. You cannot choose a different seed file.
    • Set to 2: the default DWG seed file is set by MS_DWGSEED at the beginning of each session. You can choose a different seed file during the session.
  • MS_DWGSETTINGSFILE: Points to the file that contains the settings for opening and saving DWG files.

  • MS_DWGSHEETMODELSEED: Identifies the file containing the seed model for new sheet models in DWG files.

  • MS_DWGSHEETMODELSEEDNAME: Identifies the seed model for new sheet models in DWG files.

  • MS_DWGSYSTEMDATA: Identifies the directory containing the DWG settings file Dwgsettings.rsc. Overrides the directory specified by MS_DWGDATA. The display and plotting color tables (DwgDisplayColor.tbl and DwgPlotColors.tbl) can also be controlled by placing them in this directory.

  • MS_MERGE_DISPLAYEDLEVELSONLY: Modifies Copy Levels During Merge setting on the References tab of the Save As DWG/DXF Options dialog, Save As V8 Options dialog. When set (to 1), only those reference levels that are displayed in the selected view are merged into the output file. If not set, and the Merge Displayed Levels Only setting is off, then all reference levels are merged into the output file.

  • MS_NO_DWG_BACKUP: If set, backup files (.bak) are not created when you edit a DWG or DXF file.

  • MS_TRANSEED_OVERRIDE: Determines whether a user can modify the DGN Seed File setting on the DWG Open Options dialog.

    • Not set or set to 0: the first time the dialog opens, the default DGN Seed File is set by MS_TRANSEED. You can choose a different seed file.
    • Set to 1: you can only use the DGN seed file identified by MS_TRANSEED. You cannot choose a different seed file.
    • Set to 2: the default DGN seed file is set by MS_TRANSEED at the beginning of each session. You can choose a different seed file during the session.
  • MS_WORKMODE: Defines the workmode as either DGN or DWG.