Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
  • Welcome
  • Products
  • Support
  • About
  • More
  • Cancel
Printing and Plotting
  • Product Communities
  • MicroStation
  • Printing and Plotting
  • More
  • Cancel
Printing and Plotting
Printing and Plotting Wiki How to create a Named Expression that will give you the name of the pen table and the name of the design file being printed?
    • Sign in
    • Printing - Wiki
    • 3D Printing
    • -MicroStation
      • How do I change the date format used in Text Substitution to reflect MM/dd/yy?
      • -Printing - MicroStation
        • An internal printing error occurred - SystemPrinter.GetCurrentFormGeometry
        • +Design Script - Printing - MicroStation
        • +Dialog - Printing - MicroStation
        • +Driver/PDF - Printing - MicroStation
        • +Driver/SYSPRT - Printing - MicroStation
        • How to avoid the change of "Date Modified" in Windows Explorer, when printing a MicroStation drawing
        • How to create a Named Expression that will give you the name of the pen table and the name of the design file being printed?
        • Inserting the value of a variable into the pdf filename using Named Expression
        • +Knowledge Articles
        • Open Windows Explorer automatically after the PDF creation process is finished
        • +Organizer - Printing - MicroStation
        • +Pen Table - Printing - MicroStation
        • Plotting to Port LPT1 generates the following message: LPT1 This file name is reserved for use by Windows. Choose another name and try again
        • +Print Def/Raster - Printing - MicroStation
        • Raster image prints inverted
        • System fault 20301 Exception error when attempting to print.
        • +Technotes and FAQs
        • The presentation order of elements, which are set with a pen table (priority) are shown wrong in the print preview and on the printout.
        • Video: MicroStation Print Organizer - Create a print set from a shape
        • +Videos
        • Windows plot subclass-check failed, code 3419
        • Windows Print Spooler Vulnerability
    • +Printing
    • +ProjectWise InterPlot Organizer

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

    How to create a Named Expression that will give you the name of the pen table and the name of the design file being printed?

       
      Applies To 
       
      Product(s): MicroStation
      Version(s): System.Data.DataRowView
      Environment:  N\A
      Area:  Printing
      Subarea:  N\A
      Original Author: Frank Reimann, Bentley Technical Support Group
       

     

    Problem
    This document illustrates how to create a Named Expression that will give you the name of the pen table (without file extension) and the name of the design file being printed (without file extension) separated by an _ character. 
    Solution
    The Named Expression should be store in a global Design (DGN) library (*. Dgnlib) for all User. The MicroStation Variable MS_DGNLIBLIST is referencing to this Design (DGN) library
    Create and open a Named Expression.dgnlib in …\WorkSpace\Interfaces\MicroStation\default.
    Open the MicroStation print dialog box (absolutely necessary)
    Open Utilities -> Named Expressions
     
    Select the icon New and enter a name Internal name and External Name for example PenTableName. Enter a description for this Named Expression.
    Keywords Dialog box -> Select Print Set
    Symbol Sets -> Select the drop down box and select PrintDefenition -> Add and System.Path -> Add
    Expression
    Enter the following expression
    System.Path.GetFileNameWithoutExtension(PrintDefinition.PenTableFile) & "_" & System.Path.GetFileNameWithoutExtension(PrintDefinition.SourceFile)
    Save and close the Named Expression dialog box and open a design file for example House_Model.dgn.
    Now you have to insert the Named Expression in the printer configuration file
    MicroStation -> File -> Print-> the Print Dialog box opens -> File -> Select Bentley Driver -> select the Bentley driver pdf.pltcfg -> open -> the print dialog box is open -> file -> Edit Printer Driver Configuration
    Base Properties TAB ->  Default Print File Name ->
    Here is the place to insert the Named Expression
    File Name =  <expr?name=PenTableName>
     
    After you have changed the resolution go to File -> Save; File -> Exit.
    The Print Dialog box is now open go to File -> Reload Printer Driver Configuration
    If you create now a PDF file from the design file House_Model.dgn and the Pen Table Project_0001_2015, the file name will have the name
    Project_0001_2015_House_Model.pdf

    • Printing
    • MicroStation
    • SELECTsupport
    • Share
    • History
    • More
    • Cancel
    • Frank Reimann Created by Frank Reimann
    • When: Tue, Feb 24 2015 7:50 AM
    • Dawn Clark Gentry Last revision by Dawn Clark Gentry
    • When: Wed, Mar 4 2015 8:01 AM
    • Revisions: 4
    • 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