Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
  • Welcome
  • Products
  • Support
  • About
  • More
  • Cancel
MicroStation
  • Product Communities
  • More
MicroStation
[Archived] AskInga Wiki Locating reference attachments
    • 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
        • Associate a reference to a sheet for auto-scaling
        • Attach a file to itself
        • Attach a file to itself faster
        • Attach a saved view from a reference with this keyin
        • Attach multiple models fast and easy
        • Attach multiple references from Windows Explorer
        • Attach references from current working directory faster
        • Attach references without a dialog
        • Attach the default model as a reference with this macro
        • Attaching reference file with a config variable
        • Auto-update reference level display symbology and more
        • Batch merge references
        • Can't see all of your reference tools
        • Change reference slot numbers with ease
        • Change update sequence with drag-drop
        • Clip a reference with an element not a fence
        • Clip and mask a reference with a group hole
        • Clipped references and rotated views
        • Control update sequence with transparent reference elements
        • Copy reference attachments
        • Determine attached references without starting MicroStation
        • Difference between Coincident and Coincident World
        • Display references with greater clarity
        • Displaying new levels in references
        • Ditto ticks in reference dialog
        • Drag and drop models into reference dialog
        • Exaggerate Y-Scale on profiles
        • Exchange into reference based on logical name
        • Exchange references with this macro
        • Force MicroStation to look at the full path of references
        • Force new design models to always be drawn on top of references
        • Force new levels in references to be on
        • Force references to be attached Coincident - World or Coincident
        • Highlight references
        • How to attach a reference saved view at a known location
        • Interrupt reference manipulations
        • Keyin to attach file to itself as a reference
        • Keyin to attach references
        • Keyin to change Use References dialog list
        • Keyin to make a nested attachment a direct attachment
        • Keyin to save changes to reference levels or not.
        • Keyin to set reference adjustment colour
        • Keyin to toggle the display of references
        • Keyins to change reference highlight mode
        • Locating reference attachments
        • Maximum nested attachments setting
        • Maximum number of clip shapes
        • Measuring a scaled reference
        • Merging files
        • Merging reference files during a Save As
        • Modify reference clip boundary
        • Move clipped reference not clipping element - Method 1
        • Move clipped reference not clipping element - Method 2
        • Move clipped reference not clipping element - Method 3
        • Number of clip masks allowed
        • Preset all reference attachment settings
        • Quickly toggle the display of references
        • Reference changes not undoing
        • Reference level display keyins
        • Reference presentation
        • Reference settings in saved views
        • Relative reference file names
        • Removing Save Full Path from references
        • Rewrite reference attachments without the full path
        • Rotating reference files
        • Saving reference level changes
        • Search for text in a reference file
        • Select all levels or all references
        • Standardize reference logicals
        • To quickly open an attached reference
        • Turn off highlighting when manipulating references
        • Unfold your references with ease
        • Use nested references to manage reference attachments a bit better
        • Using Master-Ref scale for details
      • +Tags - Data Fields - Fields
      • +Text - Fonts - Annotation
      • +Views
      • +Windows - Interacting With
      • +Workspaces - Configuration
    • graffiti

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

    Locating reference attachments

    Reference attachments have always been one of MicroStation's most important features. In this article we explore the variety of ways MicroStation V8 can save the file name for reference attachments and the algorithm that it uses to locate references when a DGN is opened.

    When a file is attached as a reference, the master file to which it is attached must record the name of the file so it can be opened in future sessions. The way that the file name is stored has been the source of some user frustration in the past, and has undergone some refinements as MicroStation has evolved.

    The most obvious way of storing the file name is to simply save the full file specification of the reference. That is, if the file is c:\activeProjects\project704\structural\steel.dgn, simply store that full string in the master file. While MicroStation/J (which we now sometimes refer to as "V7") and earlier versions gave the user a way of forcing this result, it has never been the recommended procedure.

    The problem with this approach is that it is completely inflexible. If the whole project is moved to a different disk or a different directory on the same computer, then the reference file will not be found. If the project is kept on a file server, then the share point is likely to be different for different users, and the reference might be located on some computers but not others. The only solution is to go into every file and modify the reference attachments for each one.

     
    Figure 1. A sample project directory structure.

    For this reason, the default behavior for graphically chosen reference files is to store only the file name and extension of references, and then rely on the user or project administrator to set the reference file search path configuration variable MS_RFDIR properly for each project. MS_RFDIR can be set to a list of directories (separated by semicolons); MicroStation searches each directory for the reference attachments.

    The advantage of this approach is that moving a project, or parts of a project, does not require any changes to the DGNs. It does require changes to MS_RFDIR. A disadvantage is that MS_RFDIR has to be set differently for each project.

    Using configuration variables

    Another approach supported since MicroStation V4 is to define specific configuration variables and to use the configuration variable to establish the directory in which the reference file resides. For example, consider the following project directory structure shown in Figure 1. A project administrator could define configuration variables (Figure 2). The references could then be attached by either keying in reference attach P704BORDERS:border_a.dgn or using the Select Configuration Variable option in the Directory menu of the reference file selection dialog. In either case, MicroStation stores the file name as P704BORDERS:border_a.dgn.

    P704BORDERS = c:\activeProjects\project704\borders\
    P704STRUCT= c:\activeProjects\project704\structural\
    P704SITE=c:\activeProjects\project704\site\

    Figure 2. Configuration variables.

    The advantage of this approach is obvious; if the project is moved (e.g., to c:\InActiveProjects\, or to a file server), the only change needed is to redefine the configuration variables. In fact, the astute project administrator would probably set the configuration variables like as shown in Figure 3 and then would need to redefine just PROJECT704-the other configuration variables redefine themselves automatically.

    Configuration variable relative file names

    An enhancement to MicroStation/J allowed reference files to be specified as "relative" to a configuration variable. Thus, given the directory structure in the example above, the project administrator could define a single configuration variable, PROJECT704, and the reference above could be attached using the key-in reference attach PROJECT704:borders\border_a.dgn.

    PROJECT704=c:\activeProjects\
    P704BORDERS = $(PROJECT704)project704\borders\
    P704STRUCT= $(PROJECT704)project704\structural\
    P704SITE=$(PROJECT704)project704\site\

    Figure 3. Revised configuration variables.

    The advantage to this approach is that there is only one configuration variable, so users don't have to think much to know which to use.
    There are two disadvantages to this method. First, there is no convenient way to get this result when selecting a reference file using the reference file selection dialog. Second, it "locks in" the project directory structure. The entire project can easily be moved to another root directory or file server, but the internal directory structure can only be changed by making changes to reference attachments.
    An interesting variant of using configuration variable relative file names is using the built-in configuration variable _DGNDIR, which always points to the directory of the current master file. The advantage is that there is no need to define any configuration variables, but the same disadvantages above still apply-the internal project directory structure must be stable, and there is still no way of getting this result from the graphical file selection process.

    Master file relative file names

    In MicroStation V8 (version 08.00.01.19 and later) there is a new capability for storing the reference file names relative to the master file. This effect is similar to that described above when file names are stored relative to the configuration variable _DGNDIR, but there is a distinct advantage when MicroStation V8's live reference nesting is used. If the master file references a file in another directory that has its references stored relative to _DGNDIR, those nested references won't necessarily be found because _DGNDIR now refers to the directory of the master file rather than the directory of the top-level reference file. MicroStation V8 stores the relative path directly to avoid that problem.

    Another advantage is that it is possible to specify relative paths when using the Reference File selection dialog. The Save Relative Path toggle in the lower left of the dialog (Figure 4) tells MicroStation to store the relative path to the DGN. For system administrators who do not want to allow relative paths, the MS_DISALLOWRELATIVEREFPATH configuration variable can be set to 1 to remove the Save Relative Path option from the reference selection dialog and disallow relative paths.



    Figure 4. Attach Reference dialog.

    Using relative paths eliminates the need for defining project- specific configuration variables or redefining MS_RFDIR, but, as pointed out above, it limits flexibility by requiring that a project maintain an unchanged internal directory structure.
    Relative paths should not be used for references to DGNs in another project, or are shared between projects.

    V8 reference file searching

    For each reference file, MicroStation stores a file specification in the reference attachment. The stored file specification is displayed to the user in the File Name column of the References dialog. When a reference is attached, MicroStation examines way the file was chosen and decides what to store for the file specification that will give the user the best results in terms of flexibility and maintainability.
    If a configuration variable is selected from the reference file selection dialog, or entered as part of the name in the reference attach key-in, the configuration variable is always retained as part of the file specification. The file is specified relative to a configuration variable in the reference attach key-in, the configuration variable and the relative path are always retained as part of the file specification. If a relative path is specified through the reference file selection dialog or as part of the name in the reference attach key-in, the relative path is always retained. Otherwise, only the file name is retained.

    Beginning with MicroStation V8, MicroStation also saves the full file specification of where the reference file was located. This is very convenient for the user attaching the reference file, because it means that they will always be able to locate the reference file when they reopen the master file (unless, of course, they move or delete the file). However, because other project participants might not have the same directory structure or file shares, the full file specification might not enable them to locate the file. Therefore, this behavior can be prevented by setting the configuration variable MS_DISALLOWFULLREFPATH, and many project administrators choose to do so.
    When MicroStation opens a file, it searches for references in the following places, in order:

    1. If the file specification contains a configuration variable, look in that directory first, using the relative path, if any.
    2. Search a list of directories, which consists of all the directories for the parent file(s) of the reference. If a reference is attached directly to the master file, the search path consists only of the directory of the master file. If it is a nested references, the path consists of the directories of each parent file, starting with the most deeply nested. Starting with the MicroStation V8 update 8.00.01, the directories searched include the relative path, if any, in the file specification.
    3. Search all the directories in MS_RFDIR, again retaining the relative path, if any, in the file specification.
    4. Use the full file specification in the reference attachment, if there is one.

    This search algorithm is designed to maximize the chances that each project participant will find the correct reference file.

    • Share
    • History
    • More
    • Cancel
    • Inga Morozoff Created by Bentley Colleague Inga Morozoff
    • When: Mon, Jun 14 2010 10:24 AM
    • Inga Morozoff Last revision by Bentley Colleague Inga Morozoff
    • When: Mon, Jun 14 2010 10:25 AM
    • Revisions: 2
    • 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