Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
OpenUtilities
  • Product Communities
OpenUtilities
OpenUtilities Wiki Run key-ins when a page is opened
    • Sign In
    • +OpenUtilities
    • Access Service Request Manager
    • +Bentley sisHYD Multi Utility
    • Design Features - promis.e Functionality - Promis.e Standard
    • +OpenUtilities sisNET - English
    • +OpenUtilities Substation
    • Promis.e Paths
    • -Promis.e Wiki
      • +CONNECT Edition - Promis.e
      • About Promis.e
      • +Administration Features - Promis.e
      • +APIs_VBA - Promis.e
      • +Automation Features - Promis.e
      • +Component Features - Promis.e
      • +Component Management - Promis.e
      • +CONNECT Services - Promis.e
      • +Data Manager - Promis.e
      • +Database Platform Support - Promis.e
      • +Display - Promis.e
      • +Drawing Management - Promis.e
      • +Engineering Design Considerations - Promis.e
      • Error - Object reference...General
      • +Find_Replace - Promis.e
      • Finding the Tutorial
      • +Installation_Configuration - Promis.e
      • +Interoperability - Promis.e
      • +Licensing - Promis.e
      • +Maintenance Features - Promis.e
      • +Migration - Promis.e
      • +OS Support - Promis.e
      • +Panel Layout - Promis.e
      • +Performance - Promis.e
      • -PowerPlatform Support - Promis.e
        • Area inside the sheet border is filled white
        • Assign actions to function keys
        • Attaching References (Auxiliary Views)
        • Blank, gray project pages
        • Customizing the Interface - CONNECT Edition
        • Customizing the Interface - V8i
        • Elements missing from published or plotted output
        • Empty box is stuck on the screen
        • Error - Format version not supported, not recognized file format
        • Error - Unable load/create dialog item of type 'HTML', id=41510001
        • Inserting Drawings
        • Inserting Elements By Coordinates
        • Inserting Raster Images
        • Inserting Tables
        • Make custom styles available for all pages, symbols
        • +Manipulate Tools - PowerPlatform Support - Promis.e
        • Masking Elements
        • MicroStation Help file
        • Off-grid wires and symbols
        • Pasted elements rotated or scaled
        • Platform Fundamentals for Promis.e Standalone Users
        • promis.e is read-only
        • Restore Platform Defaults - Promis.e
        • Run key-ins when a page is opened
        • Set DGN files to update fields automatically
        • Symbols jump when moved or placed
        • Tools Are Missing From Tasks Menu
        • Turn the Task Bar Menu Back On
        • Unreadable or disappearing elements upon selection
        • View is rotated
      • +Print_Publish Features - Promis.e
      • +ProjectWise Integration - Promis.e
      • Promis.e Help file
      • +Reports_Output Features - Promis.e
      • +Template Management - Promis.e
      • +Text Tools - Promis.e
      • Training FAQs
      • +Wire Numbering - Promis.e
      • +Wiring Features - Promis.e
      • +Project Management - Promis.e
      • Promis.e Title
      • Working from home with Promise.e
    • Replace Family - Find_Replace - Promis.e
    • SQL Server Login

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

    Run key-ins when a page is opened

      Product(s): Promis.e, Bentley Substation
      Version(s): through 08.11.13.96
      Environment: N\A
      Area: PowerPlatform Support
      Subarea: N\A

    How can I execute commands whenever a page is opened?

    Background

    This article describes how to run key-in commands whenever a page is opened in standalone Promis.e or Bentley Substation. This is done by using MicroStation BASIC and MicroStation macros containing the desired key-ins. Many Promis.e and Bentley Substation tools in addition to platform tools can be invoked by key-ins.

    To demonstrate the technique, the software will be configured so that the Fit View tool will be invoked when a project page (or any DGN file) is opened. In previous versions the software performed a Fit View operation automatically. By request, this was removed in SELECTseries 8, but some users would still like Fit View to happen automatically. The example can be adapted to other commands, and the macro could contain multiple commands.

    Note: Fit View is used as an example for this document. An easier method of enabling the Fit View behavior in Promis.e V8i SELECTseries 8 is to set the "Fit View" on page open check box on Options > User Options > Viewing Preferences.

    Steps to Accomplish

    For each pair of paths below, use the one appropriate for your software (Promis.e vs. Bentley Substation).

    1. Use Windows Explorer to copy runmacro.ma to the \mdlsys\asneeded\ folder.

      The runmacro.ma file is typically located in:
      C:\Program Files (x86)\Bentley\promise V8i\Promise\mdlapps\
      C:\Program Files (x86)\Bentley\Substation V8i\Substation\mdlapps\

      and should be copied to:
      C:\Program Files (x86)\Bentley\promise V8i\Promise\mdlsys\asneeded\
      C:\Program Files (x86)\Bentley\Substation V8i\Substation\mdlsys\asneeded\
    2. Open Promis.e or Bentley Substation as the case may be.

    3. Select Utilities > Macro > MicroStation BASIC from the main pull down menu.

    4. On the Macros dialog, click the New button.

    5. Enter the following into the text pane on BASIC Editor:
      Sub main
         MbeSendCommand "FIT VIEW EXTENDED 1"
      End Sub

    6. Select File > Save on the BASIC Editor dialog. Name the macro pageopen so a pageopen.bas file is created.
      Note where the macro is saved if it is to be distributed to other users. It is typically stored in:
      C:\ProgramData\Bentley\Promise V8i\WorkSpace\Standards\macros\
      C:\ProgramData\Bentley\Substation V8i\WorkSpace\Standards\macros\

    7. Close the dialog.

    8. Close the software.

    9. Using Notepad to add the following lines to untitled.ucf:
      MS_DGNAPPS > runmacro
      MS_DGNMACROS = pageopen.bas

      The untitled.ucf file is typically located in:
      C:\ProgramData\Bentley\Promise V8i\WorkSpace\Users
      C:\ProgramData\Bentley\Substation V8i\WorkSpace\Users

    10. Start the software.

    To distribute the functionality to other users, distribute the pageopen.* files, the untitled.ucf file (or append to theirs), and copy the runmacro.ma file to the \mdlsys\asneeded\ folder.

    See Also

    Run commands or BASIC macro when opening files

    Run a VBA macro when opening or closing design files

    Customizing the Interface - V8i

      Original Author: Matt_P

    Keywords: zoom, extents, screen, maximize, all, script, macro, open, close

    • PowerPlatform Support
    • promis.e
    • how to
    • Bentley Substation
    • en
    • SELECTsupport
    • Share
    • History
    • More
    • Cancel
    • Matt_P Created by Communities MVP Matt_P
    • When: Fri, Oct 14 2016 6:28 PM
    • Satish Saptasagar Last revision by Bentley Colleague Satish Saptasagar
    • When: Mon, Apr 13 2020 9:25 AM
    • Revisions: 7
    • 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