Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
MicroStation
  • Product Communities
MicroStation
[Archived] AskInga Wiki Understanding and using NTBang
    • Sign In

    • -AskInga
      • +3D MicroStation
      • +AccuDraw Secrets
      • +Animation - Rendering
      • +Behind The Scenes
      • +Cells
      • +Colours
      • +Conversion - Translation
      • +Coordinate Input
      • +Design Settings
      • +Dimensions
      • +DWG
      • +EDG
      • +Element Manipulation
      • +Element Properties
      • +Element Selection
      • +Freeware - Shareware
      • +Interface Look And Feel
      • -Internet - E-Links - Links
        • Customize action for MicroStation On The Web - Bentley Library button
        • Drive MicroStation from a webpage using UstnForm protocol
        • Google Earth KML or KMZ
        • Keyin to access a website from withing MicroStation
        • Link multimedia files to graphical elements with this macro
        • Linking elements to a webpage
        • Linking to external documents
        • Links on elements
        • Understanding and using NTBang
        • UstnKeyin protocol
      • +Keyins
      • +Levels
      • +Line Styles
      • +Models
      • +MSM Archive
      • +Other
      • +Presentations
      • +Printing - Plotting
      • +Programming - Automation
      • +Rasters - Images
      • +References
      • +Tags - Data Fields - Fields
      • +Text - Fonts - Annotation
      • +Views
      • +Windows - Interacting With
      • +Workspaces - Configuration
    • graffiti

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

    Understanding and using NTBang

    AskInga logo

    Original Article Date: March 18, 2004

    NTBang is an MDL application which provides a system command prompt for the execution of external programs. It is especially useful when attaching Engineering Links to elements to open external documents or to simply pop out to DOS to perform DOS commands.

    In Pre-V8 MicroStation, the source code is delivered when you install the MDE Programming Tools. In addition, the source code for both MicroStation Pre-V8 and V8 can be found here http://microstation.bentley.com/files/motw/resources/utilities/V8MDLExamples.zip

    If you're like me and have no clue how to compile an MDL, you can grab the compiled versions from the following links...look at the very bottom for the attachment. With a huge thank you to Barry Bentley for making these available!

    NTBang for MicroStation pre-V8
    NTBang for MicroStation V8

    Now that you've got a copy of NTBang, you'll need to do a couple of housekeeping tasks:

    Place the compiled version of NTBang in the ...\Program\MicroStation\mdlapps\ folder,
    Add or set the configuration variable MS_CONSMODE = 1
    And finally set MS_DGNAPPS to point to the NTBang MDL application.

    MicroStation V7 - NTBang Keyins:
    Once you've completed the above tasks, you'll be able to shell out to DOS and send DOS based keyins from MicroStation's keyin window. For example the following keyins and resulting actions can be expected in Pre-V8 versions of MicroStation.

    To open the DOS window use one of these keyins:
    dos
    DOS
    !

    To open the DOS window, run a command and automatically close the DOS window:
    dos [command]
    DOS [command]
    ! [command]
    % [command]

    MicroStation V8 - NtBang Keyins:
    For later versions of MicroStation, the results will be slightly different.

    To shell out to your Windows folders:
    DOS or dos

    To shell out to the DOS window:
    !

    To shell out to DOS and run a DOS based command:
    ! [command]

    To open a file and lauch the application associated with the file format:
    (MicroStation V8.5 - 2004 Edition and later)
    % file_name

    Special Considerations for MicroStation pre-V8:
    DOS can only handle file and folder names up to 8 characters which means you'll have to abbreviate long names with ~1:
    !C:\Progra~1\Micros~1\Office\EXCEL.EXE d:\data\MyStuff.xls

    If you're having trouble excecuting certain commands, test the command outside of MicroStation using the normal Windows command prompt.

    In some situations, you may need to add Start to the beginning of the command line as follows:
    !start winword d:\temp\My_Notes.doc
    !start excel d:\temp\My_Data.xls

    Final Thoughts:
    The keyins for NTBang and the results they produce may vary depending upon the version of your Windows operating system.

    The keyins for NTBang and the results they produce may vary depending upon the version version of MicroStation you're running.

    AskInga Article #188

    • Internet ELinks Links
    • Askinga
    • Share
    • History
    • More
    • Cancel
    • CTennyson Created by Bentley Colleague CTennyson
    • When: Wed, May 28 2008 1:05 PM
    • Jordan Stierly Last revision by Jordan Stierly
    • When: Fri, Jun 11 2010 2:37 PM
    • Revisions: 5
    • Comments: 3
    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