Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
  • Welcome
  • Products
  • Support
  • About
  • More
  • Cancel
MicroStation
  • Product Communities
  • More
MicroStation
[Archived] AskInga Wiki Creating a configuration file
    • Sign in

    • -AskInga
      • +3D MicroStation
      • +AccuDraw Secrets
      • +Animation - Rendering
      • +Behind The Scenes
      • +Cells
      • +Colours
      • +Conversion - Translation
      • +Coordinate Input
      • +Design Settings
      • +Dimensions
      • +DWG
      • +EDG
      • +Element Manipulation
      • +Element Properties
      • +Element Selection
      • +Freeware - Shareware
      • +Interface Look And Feel
      • +Internet - E-Links - Links
      • +Keyins
      • +Levels
      • +Line Styles
      • +Models
      • +MSM Archive
      • +Other
      • +Presentations
      • +Printing - Plotting
      • +Programming - Automation
      • +Rasters - Images
      • +References
      • +Tags - Data Fields - Fields
      • +Text - Fonts - Annotation
      • +Views
      • +Windows - Interacting With
      • -Workspaces - Configuration
        • All about saving DWG files
        • Auto-open a file to a specific model
        • Change the MicroStation Manager workspace options
        • Complete list of MicroStation V8's configuration variables
        • Compress your UPF file
        • Configuration variable operators
        • Configuration variable processing
        • Configure your compress options
        • Control the output location of MicroStation Packages
        • Convert MDF files to DGNLIB
        • Create new UPF every time you start MicroStation
        • Creating a configuration file
        • Current working directory
        • Customized Standards Checker Reports
        • Degeek MS DESIGN HISTORY REVISION NUMBER FORMAT
        • Deleting your UPF while retaining most settings
        • Digging into your workspace
        • Disable stuff MicroStation can or can't do
        • Do you really need to restart MicroStation when editing variables?
        • Edit Project variables via workspace configuration
        • Get rid of MicroStation Text Window
        • Have only one UPF regardless of the workspace you are using
        • How to figure out what the command line switches are
        • How to set WORKDIR DGNDIR after starting MicroStation
        • Learning about workspaces
        • List the configuration variables
        • Lock down your variables
        • Managing MicroStation backup directories
        • MicroStation J and V8 workspaces on the same computer
        • MicroStation J enhanced workspace functionality
        • MicroStation J Workspaces
        • Monitor your UPF file
        • Move your custom interface from one machine to another
        • MS_RFDIR limitations
        • Open V7 files without reconfiguring V8
        • Open Windows Explorer to location of workspace files
        • Preprocessor directives for processing configuration files
        • Quickly restore the defaults with a command line switch
        • Referencing other configuration variables
        • Regarding the last line in a configuration file
        • Report your variables with Expand Echo keyin
        • Return to the MicroStation Manager
        • Run Debug from a modified icon
        • Run debug from the command prompt DOS window
        • Set temporary variables with the Expand Set keyin
        • Set up a seed file for your UPF file
        • Setting the MS_OPENV7 variable
        • Sharing your workspace
        • Shawn Foster's BE 2005 presentations
        • Show all configuration variables not just some
        • Show full path of active file in title bar
        • Specify sub-folders when making a new project
        • Specify the folder for msdebug.txt
        • Temporary files
        • The types of configuration variables
        • The User Preference File [UPF]
        • Total length of file paths
        • Transcending the workspace and time continuum
        • Understanding configuration variables
        • Understanding MicroStation BASIC configuration variables
        • Use a library legend to help manage your library definitions
        • User interface hierarchy
        • Viewing and determining the configuration variables
        • What happens when you launch MicroStation?
        • What is a workspace?
        • Working with V7 files in V8
        • Workspace root
        • You're the CAD Manager, now what?
    • graffiti

     
     Questions about this article, topic, or product? Click here. 

    Creating a configuration file

    AskInga logo

    Original Article Date: Feb 1, 2001 

    Last month, we talked about getting started with a customized workspace. This month we’ll look at creating a configuration file. The configuration file is the heart of a customized workspace because it tells MicroStation where to find all your resources and directories. In this column, we will walk through the process of creating a configuration file. The first step is to do an analysis of existing resources. The next step is to create a configuration file. The last step is to use the debugger in MicroStation to make sure the configuration will work.

    2001-02-01 Originally published on MSMonline
    2006-03-20 Aquired and posted on AskInga

    Analyze this data
    In this scenario, analysis reveals that our example firm has some CAD standards in place. Standard data and resource files can be found on S:\ drive while project related data are stored on P:\ drive. Here is a table listing the resources that we have to work with.

    The table contains four types of information for each of the CAD standards:

    1. A brief description of the standard.
    2. The associated MicroStation variable.
    3. CAD Standard filename or directory.
    4. Where the Standard will be defined.

    The first variable, _USTN_PROJECTSROOT, looks different from the others because it begins with the underline character ( _ ). The underline character means the item is a MicroStation system variable. These variables are hidden when using MicroStation to view the Configuration Variables dialog. _USTN_PROJECTSROOT defines the location for the Project Configuration Files and project directories. The next five variables are self-explanatory.

    The MS_USERNAME variable sets the MicroStation username to the system username. In this example we are using a Windows NT system. When I log in the username variable is set to mramsey. Therefore, mramsey.ucf (User Configuration File) must exist in the C:\Bentley\Workspace\users directory. I created one by copying C:\Bentley\Workspace\users\untitled.ucf and renamed it mramsey.ucf. The last five variables are also self-explanatory.

    Rules for configuration files
    Before creating a configuration file, review configuration variable file syntax or rules of order. Configuration variable definitions utilize operators: Configuration Variable Operators . We’ll examine four operators: =, >, <, and : . In the text below, the pound sign (#) identifies a line that will be ignored by MicroStation; use it for comments.

    # assigns a new value to the variable
    MS_CELL = s:/cell/

    Using the equal (=) sign removes any pre-existing values and makes the new value the only value. If MS_CELL had been previously defined, the old value is lost when the equal sign is used.


    # appends the directory or file lists defined by the new value
    MS_CELL > s:/cell/

    The Greater Than sign (>) adds the new value to the end of the list. In our example, s:/cell/ will be added to the end of the list of directories for cell libraries.

    # prepends the directory or file lists defined by the new value
    MS_CELL < s:/cell/

    The Less Than sign (<) adds the new value to the beginning of the list. s:/cell/ will be added to the beginning of the list of directories for cell libraries. Now it will be the first directory to be searched.

    : assigns a new value to the variable only if that variable does not already exist
    MS_CELL : s:/cell/

    The Colon (:) sign assigns a new value only when the variable does not have an existing value. In our example, MS_CELL would be ignored since MicroStation would have already assigned a value.

    Tip: Don’t forget to end any directory definitions with a trailing slash. In configuration files, be sure to use forward slashes (/) instead of the backslash (\). This method allows the configuration file to be compatible across different platforms. DOS and Windows NT will convert the forward slash to a backslash.

    Create the Configuration File
    The next step is to create a configuration file based on our analysis. Remember, anything on a line after a pound sign (#) is considered a comment. Include as many detailed comments as possible to show what you did and why you did it.

    # Site configuration file
    # MAR 11.15.2000
    # Version 1.0


    # Directory for project configuration files
    _USTN_PROJECTSROOT = p:/

    # Directories where cell libraries can be found
    MS_CELL < s:/cell/

    # Cell libraries to search for cells

    MS_CELLIST < s:/cell/*.cel

    # Directories where seed files can be found
    MS_SEED = s:/seed/

    # Default seed file
    MS_DESIGNSEED = s:/seed/3dseed.dgn

    # List of font resource files
    MS_SYMBRSRC = s:/symbology/*.rsc

    # Define the MicroStation username to the NT system username
    _USTN_USERNAME = $(USERNAME)

    # Directories where design files can be found
    MS_DEF = p:/$(_USTN_PROJECTNAME)/

    # Directories where reference files and standard border files can be found
    MS_RFDIR = p:/$(_USTN_PROJECTNAME)/

    Notice the last two configuration variable definitions, MS_DEF and MS_RFDIR. A variable definition can include a defined variable definition. MicroStation will find the definition of _USTN_PROJECTNAME and include it in the new definition. If _USTN_PROJECTNAME = project1 then MS_RFDIR = p:/ project1/.

    Tip: Keep variable names in uppercase and definitions or new values in lower case. This makes it easier to read the variables.

    Projects need configuration too
    Remember the analysis we suggested at the beginning of this article? We decided that a couple of the variables would be used at the project level. Until now, everything had been at the site level. Directories for the design and reference files will change depending on the project. Let’s create a project configuration and then get MicroStation to read it.

    My project directory is called frommer. I’ll create a Project Configuration File called frommer.pcf and place it in the project drive.

    # Directories where design files can be found
    MS_DEF = p:/$(_USTN_PROJECTNAME)/

    # Directories where reference files and standard border files can be found
    MS_RFDIR = p:/$(_USTN_PROJECTNAME)/

    I’ll create a Project Configuration File for each of my projects. Each project will be included in the MicroStation Manager dialog.

    Implement the configuration file
    We will include the new configuration file so that MicroStation will read it. There are two ways to do this, local or network.

    To implement it locally, place the file in the C:\Bentley\ Workspace\standards directory. Name the new file zstandards.cfg so it will be read in after standards.cfg.

    To implement this on the network add the file zstandards.cfg to the C:\Bentley\Workspace\standards but with just one line:

    % include s:/site.cfg

    MicroStation will read zstandards.cfg where the include command will force it to then read s:/site.cfg.

    Run Debug From The Command Prompt DOS Window
    Test the configuration file and see if there are any errors in the process. To do this you should have a MicroStation icon on your desktop. Right-click on the icon and select Properties.

    In the target field, add -debug to the end of the line. Click OK to exit. Now double-click on the icon. A text window will open while debug runs. Press the enter key to dismiss the window. If the debug was successful a message similar to this will appear: Debugging output saved to msdebug.txt. If the debug session was not successful you’ll see an error.

    In this case, the error is telling you that MicroStation cannot find the file s:\site.cfg. You will have to figure out why the file can’t be found. It could be the network connection was not defined or the filename is incorrect. Make the correction and debug again. This is the most powerful tool you have when creating configuration files. We can’t stress how important it is for you to use it!

    The debug program writes all its data to msdebug.txt and places the file in the MicroStation directory or C:\Bentley\Program\ MicroStation. Double-click on the filename to open or use your favorite text editor to open the file. Even if your debug session ends in an error, you can open the file and see how far the debug progressed.

    You’ll see each configuration file and the way MicroStation processes all the variable definitions. The best part is at the bottom of the file. Here you will find a listing of all defined variables.

    Final thoughts
    As with everything else in MicroStation, there is more than one way to create a custom workspace. Now that you’ve seen one method, go out and experiment. You are bound to discover more ways of customizing with environment variables.

    AskInga Article #292

    • Askinga
    • Workspaces
    • Article
    • Configuration
    • Share
    • History
    • More
    • Cancel
    • Danielle Schutz Created by Bentley Colleague Danielle Schutz
    • When: Thu, May 22 2008 10:31 AM
    • Inga Morozoff Last revision by Bentley Colleague Inga Morozoff
    • When: Tue, Jun 8 2010 2:35 PM
    • Revisions: 6
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2021 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies