Custom Line Style Series Part 3: Updating Custom Line Styles Stored in a DGNLib

Custom line styles, as with any other part of a set of CAD Standards, occasionally require maintenance and updating. The methods of configuring custom line styles remain the same in the MicroStation CONNECT Edition as found with previous software versions. MicroStation supports the storage and distribution of custom line styles from within your Configuration using either a MicroStation resource library (.rsc or RSC) or a design library (.dgnlib or DGNLib). The RSC offers the convenience of being read “live” when MicroStation starts, but must always be present to display line styles correctly. The DGNLib is the newer of the 2 methods, providing benefits such as “portability” and correctly scaling custom line styles within different Working Units, that are not available when using a RSC file. Regardless of which method is chosen, the resource library is still required for editing purposes.

Note: The merits of each method were discussed in the blog post Custom Line Styles Part 2: Storing Your Custom Line Styles.

 

Viewing the Source of a Line Style Definition

Let’s begin by reviewing the source of a line style. The list of available line styles is displayed in the Attributes ribbon group. These are broken down into 2 categories: the Built-in Styles (the internal line codes) and Custom Styles. When a line style is viewed from this list, it is not possible to know the source of the line style.

This is where the Settings dialog comes in. When Settings is chosen from the list, the Line Styles dialog is opened.

From Line Styles it is possible to observe the source of a custom line style definition by picking the line style in the list of Names. The source is displayed just above the line style preview.

Here, with Batten selected, the path displayed points to the file lstyle.rsc located in the “Defaults” that is delivered with the MicroStation CONNECT Edition.

(Line Styles dialog shows the source of a line style definition)

 

In the following example, the custom line style is stored in a DGNLib located within the active WorkSet standards. If changes to a custom line style contained within this DGNLib are desired, a resource library containing the line style definition would be required.

 

When custom line styles are deployed using a design library, a line style resource file is still required for editing. An organization may decide to maintain a set of custom line style resources (stored in one or more RSC files) along with the DGNLib(s). And while this would work fine, it does include maintaining two sets of the line style definitions which could easily get out of synchronization with each other. This can prove to be problematic.

An alternate solution to maintaining two parallel sets of line style definitions is to store and deploy line styles using a DGNLib, create a RSC from the DGNLib when edits are needed, and update the DGNLib with the edits. This allows the RSC to be treated as a temporary file, regenerating it as needed when editing your line style definitions, disposing of the RSC when complete.

 

Creating a RSC File from a DGNLib

A resource library can be generated from a DGNLib (or DGN file) “on the fly” any time one is needed. To create a resource library from a DGNLib, begin by opening the DGNLib containing line style definitions as the active file:

  1. Open the source DGNLib (as an active file).
  2. Open the Line Style Editor.
  3. From the Line Style Editor, pick File > Export From DGN…
  4. Select a destination and provide a name for the new RSC file.
  5. Pick Save.

Once a RSC file has been created containing the line style definition(s), any desired edits may be made. This can include adjusting a stroke pattern, modifying the properties of a Point component, or adjusting settings such as making a line style “Physical” as seen in the following illustration.

When the desired changes have been completed, the RSC file can be saved, and the changes incorporated back into the original DGNLib.

 

Updating the DGNLib

Updating the line style definitions in a DGNLib is a simple process. This is also done using the Line Style Editor. When modifications to the line style definitions are complete, the updates may be imported into the DGNLib from the Line Style Editor.

  1. Open the destination DGNLib (as an active file).
  2. Open the Line Style Editor.
  3. From the Line Style Editor, pick File > import > MicroStation Resource File (RSC)…

 

  1. Browse to the folder, selecting the desired RSC file.
  2. Pick Open.
  3. The Select Line Styles to Import dialog then opens. From this dialog chose the desired line styles.

Note: Line style names show in read already exist in the destination file.

  1. Pick Import.
  2. An Alert dialog then displays stating that the line styles already exist in the destination, asking if you wish to overwrite them.

  3. Pick Yes To All.

The line style definitions contained in the DGNLib have now been replaced with the updated definitions.

 

Updating Line Styles in DGN Files

It is important to note that even though the updated definitions are active in the Configuration, any DGN’s that have used the original definitions will not automatically be updated. When custom line style definitions are stored in a configured DGNLib, as a line style is used the definition is first copied from the DGNLib into the active DGN file, essentially making the DGN act as its own resource library. This “local” version of the line style is then what is used to display the line style.

As with the DGNLib, DGN’s must also be updated. This can be accomplished in the same manner outlined for the DGNLib, or using the linestyle import todgn Key-in. Additional parameters can be applied to the key-in, importing only the line styles used in the active file, along with the source of the updated line style definition(s).

An example of this key-in would be:

  • linestyle import todgn used C:\WorkSpace Updates\LineStyles\LineStyleUpdates.rsc

In this example any line styles in use in the active file (DGN) that also have a definition of the same name in the specified RSC file would be updated without prompting the user for any interaction.

This method of updating can then be used in a “batch mode” using the Batch Process utility.

 

 

For more information on creating custom line styles, visit the course on the Bentley LEARNserver. 

 

Happy LEARNing!