Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
MicroStation
  • Product Communities
MicroStation
MicroStation Wiki How to quickly add a number of folders to Microstation's reference files search paths
    • Sign In

    • +MicroStation Wiki
    • -Administration Wiki
      • Adding "Display Style List" to custom Toolbox
      • +Administration - Legacy Content
      • Answers for the Levelly Challenged
      • Batch Convert Utility
      • Bentley Tablet Driver And CalComp DrawingBoard
      • Bypassing Port Problems In Windows 2000 And Windows XP
      • Cannot find survey ft option in Design File Settings > Units
      • Configuration Variable Processing
      • Configuration Variables In MicroStation V8
      • Creating Tool Icons
      • Customize item missing from Workspace menu
      • Customize Toolbox - Tool opens new Toolbox
      • DGN file association in Windows 10 (MicroStation Does not appear in list)
      • DGN Index Service - How to set up
      • DGN Index Service Setup ended prematurely – error 1603
      • Enabling Lock Pages In Memory Under Windows 7 and Vista
      • Error - Cannot locate a default SHX font. Please install msdefault.shx
      • Error - Unable to load/create dialog item of type 'IconCmd', id
      • Error 1402. Could not open key
      • Error 1603 during install
      • Error 1610 during install
      • Error 1625 during install
      • Error message when starting MicroStation, "ucf not found"
      • File Associations
      • File Correction and Audit Tools
      • Getting Started With The Standards Checker
      • Haven't Upgraded To The MicroStation V8 Format Yet
      • How to Copy User Preferences and User Configuration Files to a new or different PC
      • How to quickly add a number of folders to Microstation's reference files search paths
      • How To Reset User Preferences and Delete MicroStation's Temporary Files
      • Installing MicroStation V8 XM Edition silently
      • Installing MicroStation V8i (SELECTseries 3) Without an Internet Connection
      • Installing MicroStation V8i silently
      • Is there any easy way to determine key-ins or variable names?
      • Key-in command to define different pattern setting options
      • Keyin to encrypt dgn files
      • MicroStation - Creating a Custom Colour Book
      • MicroStation Command Line Options And Switches
      • MicroStation Failed to Start
      • MicroStation file access issues with shared network drives
      • MicroStation Memory Management
      • +MicroStation V8i Variables
      • MicroStation Virtualization FAQ
      • Migrating Customizations to MS V8i
      • Migrating Customizations to MS XM
      • MSDebug File
      • MSXML Issue
      • Networking Workspaces
      • Networking Workspaces the easy way
      • New Variables
      • Overriding And Resynchronizing Level Attributes
      • Restore MicroStation to Factory defaults
      • Script error during MicroStation Installation
      • Serving Up Efficiency
      • Sharing Your Workspace
      • System Fault 5 MDL abort in DITEMS
      • The Power Of The Workspace
      • To also see hidden Config-Variables
      • Unable to connect to an Oracle Database
      • Understanding File Locations And Reference Attachments In MicroStation
      • Updating To MicroStation V8 Format
      • Upgrading From 08.09.02.52 To 08.09.02.77
      • Windows Explorer ProgramData folder
      • Workmodes DGN/DWG
      • Workspaces on the Network
    • +Annotations Wiki
    • +Bentley View Wiki
    • +MicroStation PowerDraft
    • +Printing and Plotting
    • +Programming Wiki
    • +Visualization Wiki

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

    How to quickly add a number of folders to Microstation's reference files search paths

      Product: MicroStation
      Version: All
      Environment: N\A
      Area: Workspaces
      Subarea: General

    Add a folder and its large number of subfolder to MicroStation's MS_RFDIR variable definition, which defines MicroStation's reference files search paths

    Background

    The following steps will help adding a folder and all of its subfolders to MicroStation's reference files search paths.

    Once the variable definition is ready, this can be added to either the standards.cfg file or to a PCF, if we want a different list selection of folders to be searched for each project. 

    Steps to Accomplish

    Option 1 Add the MS_RFDIR definitons directly to the standards.cfg file or to a .pcf file

    1. Start an elevated DOS command prompt (type "cmd" in Window's search tab, then execute "cmd.exe" as an Administrator)

    2. Navigate to the folder that needs to be added to the search path

    3. Type "dir /s /b /o:n /ad > folders.txt" and hit Enter

    You will now find a file called "folders.txt" in the main folder, this file contains a list of all the subfolders of the initial directory.

    For Example, if we started the dir command in the "D:\Main folder" directory, which contained two subfolders, each with one additional subfolder, the text file will look like:

    D:\Main folder\Subfolder1

    D:\Main folder\Subfolder1\Subfolder11

    D:\Main folder\Subfolder2

    D:\Main folder\Subfolder2\Subfolder21

    This file can be opened with an advanced text editor which allows you to find and replace text and "end of carriage" characters to make the above list turn into a proper MS_RFDIR definition:

    MS_RFDIR = D:/Main folder/

    MS_RFDIR > D:/Main folder/Subfolder1/

    MS_RFDIR > D:/Main folder/Subfolder1/Subfolder11/

    MS_RFDIR > D:/Main folder/Subfolder1/

    MS_RFDIR > D:/Main folder/Subfolder2/Subfolder21/

    Where I have simply replaced "D:" with "MS_RFDIR > ", "\" with "/" and "End of line character" with "/" (this requires an advanced text editor with support for regular expression and special character but can be done manually for small lists). The main folder path needs to be added manually.

    You can copy and paste the "MS_RFDIR" entries into any PCF that requires them or into your standards.cfg if you want all of your projects to search these paths for reference files.

    Option 2 Create a separate cfg files for reference search paths

    In this case we will simply follow all the steps in Option1 above but then save the final MS_RFDIR definitions list as a separate configuration file, e.g. "reference_paths.cfg"

    We can then specify to include these variable definitions into any other configuration files (e.g. PCF, UCF, etc) by adding the following string to it:

    %include reference_paths.cfg

    This can be useful when the exact same folders are using by several projects as updating one centralized .cfg file will update all PCFs using it.

    See Also

    Making Configuration Files Legible in Notepad++

    Other language sources

    • WorkspacesHow To
    • MicroStation
    • Workspaces
    • how to
    • SELECTsupport
    • Configuration
    • Share
    • History
    • More
    • Cancel
    • Marco Salino Created by Marco Salino
    • When: Tue, Nov 19 2013 7:40 AM
    • Marc Thomas Last revision by Bentley Colleague Marc Thomas
    • When: Mon, Aug 7 2017 5:55 AM
    • 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

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