Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
Printing and Plotting
  • Product Communities
  • MicroStation
  • Printing and Plotting
  • Cancel
Printing and Plotting
Printing and Plotting Wiki Inserting the value of a variable into the pdf filename using Named Expression
    • 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. 

    Inserting the value of a variable into the pdf filename using Named Expression

    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:

    A MVBA is searching for a certain Tag in the design file. The value (in this case 05) of this Tag is saved in the variable PLOT_INDEX. The value of the variable should replace the placeholder ## of the sheet model name when creating a pdf file.
     
    Variable Plot_Index with value 05
     
    Name of the model with placeholder ##
     

    Solution:

    The following named expression can be used to get the desired result.
     
    System.String.Substring (PrintDefinition.MasterModelName, 0, 11) &
    ConfigVar.GetExpandedConfigVar ("PLOT_INDEX") & System.String.Substring
    (PrintDefinition.MasterModelName, 13, -1)
    Insert the name of the named expression PLOT_INDEX in the pdf printer driver configuration file
     
    The PDf file name result looks like this. The placeholder ## was replaced by the value of the variable PLOT_INDEX
    This named expression only works in the context of the print dialog box
    You will find a detailed description - How to create a named expression - here
    VBA to extract the Tag value and update Configuration variable "PLOT_INDEX" value.
    TagValueToConfVar.mvba
    • Printing
    • MicroStation
    • VBA
    • en
    • SELECTsupport
    • Share
    • History
    • More
    • Cancel
    • Frank Reimann Created by Frank Reimann
    • When: Wed, Jun 10 2015 7:31 AM
    • Leonard Jones Last revision by Bentley Colleague Leonard Jones
    • When: Sun, Jun 30 2019 3:10 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

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