Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
MicroStation
  • Product Communities
MicroStation
MicroStation Wiki Line Styles And DWG Files
    • Sign In

    • -MicroStation Wiki
      • +Learning Tips
      • -MicroStation
        • +3D Printing - MicroStation
        • +Animation - MicroStation
        • +Archive / Backup - MicroStation
        • +Base Geometry - MicroStation
        • +Batch Processing - MicroStation
        • +CONNECT Advisor - MicroStation
        • CONNECT Integration - MicroStation
        • +CONNECTION Client
        • +Cells - MicroStation
        • +Change Tracking - MicroStation
        • +Configuration - MicroStation
        • +Coordinate Systems - MicroStation
        • +Curves - MicroStation
        • +Custom Linestyles - MicroStation
        • +DGN - MicroStation
        • -DWG - MicroStation
          • +Dimensions - DWG - MicroStation
          • +Edit - DWG - MicroStation
          • -General - DWG - MicroStation
            • 3D LineStrings are becoming planar when saved to DWG
            • AutoCAD PGP Files
            • Bentley CONNECT Edition - Autodesk RealDWG(TM) FAQ
            • Bentley V8i (SELECTseries 4) - Autodesk® RealDWG™ 2016 FAQ
            • Bentley V8i - Autodesk RealDWG(TM) FAQ
            • Cannot Copy/Paste Block from DWG to DGN
            • Cannot open Civil3D DWG fully in Microstation.
            • Civil 3D 2022 Object Enabler failure message when opening DWG files
            • Crash when opening any file - Windows error message
            • Creating a DWG Viewport using MicroStation
            • DGN - DWG Terminology
            • DGN reference files in DWG work mode
            • Disable autosave for DWG/DXF files
            • Display of some text in DWG viewports is not scaling correctly
            • DWG DXF Units Alert Box
            • DWGs created in AutoCAD Plant 3D cannot be displayed as Solid
            • Enable "RealDWG 2016" Update for DWG 2015/2016 format in SS3/SS4
            • Having saved my DGN to DWG why am I seeing duplicate Layers with ( Construction )
            • How to attach an ECW raster image to a DWG file within MicroStation?
            • How to download Autodesk REALDWG
            • How to get the DWG units alert box back
            • How to store DWG settings that will be used on a number of files.
            • In a DWG drawing with clipped reference
            • Line Styles And DWG Files
            • Line styles from reference appear as style Continuous
            • Microstation J support for AutoCAD 2004/2005
            • OHM symbol in blocks in DWG is not displayed correctly in V8i
            • Open views do not retain open after closing and reopening DWG
            • Option Save relative path in MS XM when working with DWG is not available
            • Place line string using ACAD line type
            • Prefix \ not working for DWG key-ins
            • RealDWG(TM) [TN]
            • Reference DXF into DXF capability
            • Referencing 3D DWG files to 2D design files elements are not correctly display
            • Supported AutoCAD Keyins
            • When in a DWG the sheet model does not show linestyles
            • Which MicroStation version supports which DWG/DXF version formats?
            • Will MicroStation support the .dwf format?
            • Would like to set up Workspace so DWG/DX...
          • +Open - DWG - MicroStation
          • +Raster - DWG - MicroStation
          • +Save - DWG - MicroStation
          • +Text - DWG - MicroStation
        • +Database - MicroStation
        • +Detailing Symbols - MicroStation
        • +Dimensions - MicroStation
        • +Documentation & Help - MicroStation
        • +Drawing Aids - MicroStation
        • +Exception - MicroStation
        • +FAQ - MicroStation
        • +Feature Based Solids Modeling - MicroStation
        • +File Access - MicroStation
        • +GUI - MicroStation
        • +General - MicroStation
        • +Graphics Display - MicroStation
        • +Groups - MicroStation
        • +Hardware / Input Devices - MicroStation
        • +Import/Export - MicroStation
        • +Installation - MicroStation
        • +Interchange - MicroStation
        • +Interference - MicroStation
        • +Internationalization - MicroStation
        • +Levels - MicroStation
        • +Licensing - MicroStation
        • +Manipulation - MicroStation
        • +Markup / Redline - MicroStation
        • +Measure - MicroStation
        • +Mesh - MicroStation
        • +Models - MicroStation
        • +Multi-Lines - MicroStation
        • +OLE - MicroStation
        • +Other - MicroStation
        • +Parametrics - MicroStation
        • +Patterning - MicroStation
        • +Point Cloud - MicroStation
        • +Printing - MicroStation
        • +Programming - MicroStation
        • +Project Navigation - MicroStation
        • +Properties - MicroStation
        • +RSS Feeds - MicroStation
        • +Reference - MicroStation
        • +Security - MicroStation
        • +Selection - MicroStation
        • +Settings - MicroStation
        • +Sheet Composition - MicroStation
        • +Solids - MicroStation
        • +Standards - MicroStation
        • +Surfaces - MicroStation
        • +Tables - MicroStation
        • +Text - MicroStation
        • +UI Customization - MicroStation
        • +Units - MicroStation
        • +View - MicroStation
        • +Visualization - MicroStation
        • Welcome Page - MicroStation
        • +Accreditation - MicroStation
        • +i.Models - MicroStation
        • +ProjectWise Integration
        • +Raster - MicroStation
    • +Administration Wiki
    • +Annotations Wiki
    • +Bentley View Wiki
    • +MicroStation PowerDraft
    • +Programming Wiki
    • +Visualization Wiki

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

    Line Styles And DWG Files

      Product: MicroStation
      Version: V8 2004, XM, V8i, CONNECT
      Environment: N\A
      Area: DWG
      Subarea: General

    Document Information

    Document Type: TechNote  

    Legacy Document Number:  8240

    How line styles are represented in DWG

    DWG line styles are a subset of MicroStation line styles. Because of this disparity, there are a number of features in MicroStation line styles that do not translate directly to DWG. Some features are lost in the translation, while other line styles will not translate at all.

    To get a better understanding, consider an AutoCAD line style specification in a .LIN file. A .LIN file is what in used in AutoCAD to import a line style definition; these files can also be used in MicroStation by choosing File > Import in the line style editor. There are 2 types of line styles that can be represented in a .LIN file. First are dash-dots, which are roughly equivalent to MicroStation Strokes:

    *DashDot,Style with dashes and dots ____ . ____ . ____ . ____ . _
    A,.5,-.2,0,-.2


     

    Example of Dash Dot Linestyle in AutoCAD

    The first line provides the name and description, and the second line provides the definition. The A stands for "Alignment" and must be the first character on the line. It is followed by positive numbers to denote dashes and negative numbers to denote gaps. In this example, the style has a (0.5) unit dash followed by a (0.2) unit gap then a dot (0 length dash) followed by another (0.2) unit gap.

    A second, more complicated line style type can contain either text from a text style or shapes from an SHX file. Examples are:

    *DISTWTR,Distilled Water Line -----DIST-----DIST-----DIST-----DIST-----
    A,.5,-.2,["DIST",STANDARD,S=.1,X=-0.15,Y=-.05],-.25

     



    Example of Distilled Water Linestyle in AutoCAD

     



    Detail of "DIST" location in linestyle in AutoCAD

    *FENCELINE1,Fenceline circle ----0-----0----0-----0----0-----0--

    A,0.5,-.2,[CIRC1,ltypeshp.shx,x=-.2,s=-.?],?,?

     



    Example of Fence Linestyle

    The dashes and gaps remain the same as for dash-dot patterns. The items inside the brackets [] define either a text string and a text style name as in DISTWTR, or a shape name and a shape file name as in FENCELINE. You can specify the X and Y offsets, the rotation, and the scale for the text or shape. These features are all that is available in a DWG line type; if you can't specify it in this format, then you can't export it to DWG.

    Line styles that will not translate:

    In practice, this means that line styles with the following features can not be exported, and therefore will not appear as available line styles in DWG work mode:

    • Any style with offset lines, such as { Railroad };


      Example of Rail Road Linestyle

       

    • Any style with non-uniform dash thickness, such as { Diamond };


      Example of Diamond Linestyle in MicroStation

    • Any style with point symbols at the beginning, middle, or end of the line segment, such as { Arrow }
    • Any style with more than 12 total Dash and/or Gap segments. (31 is max total segment count for DGN)

    Line style location appearance in DWG

    Furthermore, DWG only permits cosmetic (as opposed to functional) line styles. Although most line styles fall into this category, some line styles do depend on having specific symbols in specific locations. This is not possible in DWG because all line styles are displayed using a "centering" algorithm. This algorithm does guarantee that there will be dashes on either end of a line, but the location of the symbols is calculated as follows.

    First, the maximum number of full iterations of the style are centered on the line segment. For example, consider this line type definition used in a file with inches as working units:

    *StyleX,Set of dashes __ _ __ _ __
    A,2,-0.5,1,-0.5

    This line style definition is a total of 4 inches long. If you place a line that is 13 inches long using this style, there are 3 whole iterations with a remainder of 1 inch. The extra 1 inch is added to the starting dash, making it 3 inches long. The starting dash is then split in half, with half at the beginning of the line and half at the end of the line. Now if you stretch that line to be 15 inches, the only thing that changes is the length of starting and ending dashes, which will change from 1.5 inches long to 2.5 inches long.


    2 lines placed with "Style X" one at 13" and one at 15"

    The most severe consequence of this alignment style is that all MicroStation line styles will appear with this alignment in DWG files. For compatibility, this method of generating the line style was added to MicroStation and is called "Shift: Centered" in MicroStation's Line Style editor. All other shift types will be translated to this style when converting to DWG.



    Custom Line Style Editor showing "Shift: Center" option

    Exporting point symbols

    Because all point symbols in DWG line styles must be represented as shapes in an SHX shape file, the elements in the point symbol are converted to a shape during the translation. The font file is named dgnlstyle.shx and will appear in your DWG fonts directory just like other fonts. If you want the file to appear in another directory, you can use the following configuration variables:

    • MS_DWG_LSTYLE_FONTPATH determines the location for the font file.
    • MS_DWG_LSTYLE_FONTNAME determines the name of the font file (and therefore the name of the font).

    Each symbol in the font file will start with the name of the resource file, up to 10 characters, followed by an underscore and the name of the symbol. For instance, the example line style { Ground Line } resides in lstyle.rsc and contains a point symbol "ground". The resulting symbol is named LSTYLE_GROUND. This convention is used so that symbols can be reused for different line styles and files.

    Point Symbol Behavior previous to MicroStation V8.1

    In all MicroStation versions previous to 8.1 the behavior of the line style system was to reject any line style that can not be accurately represented by a .LIN file. If this tighter limitation is desired, it can be achieved by disabling the capability CAPABILITY_ALLOW_NON_SHX_STYLES.

    Alternative line style strategies - styles that will not export

    Some line styles won't export due to the limitations in the DWG line style system. When these are encountered, they can be handled several ways. First, the Save As remap facility will allow you to change any line style to any other line style by name. The only caveat to this is that some line styles in .LIN files require a text style to be present in the file. If you plan to use any of these styles, you should ensure that a text style with the correct name appears in the file before remapping.

    Another Save As option is to drop any non-exportable line styles to components. Using this facility line styles will appear the same in the DWG file, but the lines will not be modifiable.

    How internally stored linestyles are handled when saving to V7

    Previous to V8, MicroStation did not support the internal storage of linestyle definitions within the design file. When saving a DWG (or a V8 DGN that contains linestyle definitions) to V7, a line style resource file is generated (<filename>_lstyle.rsc). This file is created in the same folder as the design file. The resource file must be placed in a folder as defined by the variable MS_SYMBRSRC in order for the V7 file to read the line style correctly.

    Resolving custom linestyle definitions in MicroStation

    MicroStation can resolve custom linestyle definitions from two places.

    • From a MicroStation resource file (RSC).
    • From a definition stored within the active design file.

    MicroStation V8 can import line styles from an AutoCAD LIN file as well as from the standard MicroStation RSC file (new in MicroStation V8 2004 Edition). When the line styles are imported they are written directly into the DGN, their definitions are saved internally, within the DGN file itself.

    To import a Line style:

    1. From the Element menu, choose Line Styles > Edit (The "Line Style Editor" dialog will open)
    2. From the Line Style Editor dialog, choose File > Import and select either "AutoCAD Line Style File (LIN)" or "MicroStation Resource File (RSC)" -
    3. Browse to the linestyle file and choose "OK" (The "Select Linestyles to Import" dialog will open)
    4. Select linestyle(s) to import and choose "Import"

    Note: The styles will not appear in the Line Style Editor. They will only be visible in linestyle attribute combo boxes and the Custom linestyle List. The style(s) will only be available within the Design file that the style was imported.

    MicroStation can also export linestyles that are stored within a design file, to an RSC file (new in MicroStation V8 2004 Edition).

    To export a Line style:

    1. From the Element menu choose Line Styles > Edit (The "Line Style Editor" dialog will open)
    2. From the Line Style Editor dialog, choose File > Export From DGN
    3. Browse to desired location and give a name to the linestyle resource file to be that will be created

    Note: The linestyle resource must be placed in a folder as defined by the variable MS_SYMBRSRC and MicroStation will need to be restarted to be able to use the linestyles contained within.

    Controlling custom linestyle scale

    Custom linestyle scale can be controlled 3 ways:

    • Global scale factor
    • Per element
    • Per level (Bylevel or Override)

    To control custom linestyle scale globally, key in: ACTIVE LINESTYLE SCALE [scale factor] or DWG LTSCALE [scale factor]. This will affect all linestyles within the active file as well as any attached references, by multiplying the global scale factor of the active design file by the element's own custom linestyle scale factor.

    This is different than the Scale Factor setting in the Line Styles dialog box, which will set the scale factor for new elements that are placed in the design. This, unlike the global scale factor, is respected through references.

    It is also possible to control custom linestyle scales per level Bylevel and Level Overrides through the Styles tab of the Level Properties dialog accessible from the Level Manager Dialog (Levels > Properties). This will override the element scale but will still be multiplied by the Global scale factor.


    Custom LineStyle with no scales set


    Custom Linestyle with ACTIVE LINESTYLESCALE set to 2 in master file



    Custom LineStyle with ACTIVE LINESTYLESCALE set to 0 and Custom linestyle scale set to 2 for the elements in the Active file, and set to 3 for the elements in the Reference file.

    You can also control linestyle scales in ByLevel and Level Overrides through the Styles tab of the Level Properties dialog accessible from Level Manager (Levels > Properties).

     

      

    See also

    Other language sources

    Deutsch

      Original Author: Bentley Technical Support Group
    • MicroStation V8
    • TechNote
    • TN8240
    • DWG
    • Share
    • History
    • More
    • Cancel
    • Dan Koval Created by Bentley Colleague Dan Koval
    • When: Fri, Sep 6 2013 1:28 PM
    • Yvonne Lohse Last revision by Bentley Colleague Yvonne Lohse
    • When: Tue, Jun 2 2020 8:03 AM
    • Revisions: 5
    • 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