Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
  • Welcome
  • Products
  • Support
  • About
  • More
  • Cancel
MicroStation
  • Product Communities
  • More
MicroStation
MicroStation Wiki MicroStation BASIC FAQ
    • Sign in

    • +MicroStation Wiki
    • +Administration Wiki
    • +Annotations Wiki
    • +Bentley View Wiki
    • +MicroStation PowerDraft
    • -Programming Wiki
      • A class to help create and modify text element
      • A Complete Example
      • A MicroStation VBA Example With Bentley ProjectWise
      • AddIn Development Using VB.NET
      • C# .NET Template with IPrimitiveCommandEvents Class
      • Capturing Graphics in Dynamic Views
      • Compiling MDL Applications
      • Database Manipulation
      • Debugging Native Code MDL Applications
      • Developing Code in VBA
      • Developing MicroStation Applications For DWG Files
      • Drag and Drop in MicroStation
      • Error: "Cannot save changes to VBA project 'Support' because it is read-only"
      • Getting And Setting Elements Using Graphic Groups In VBA [CS]
      • Getting Started with Visual Basic
      • How To Write A Recursive Routine In MicroStation VBA [CS]
      • Introducing Segment3D Methods In MicroStation V8 2004 Edition
      • Known issues in MDL and MicroStationAPI
      • Launching VBA Applications As Initapps Or Dgnapps [CS]
      • Learning MicroStation Addins Step by Step
      • MDL - Getting Started With XAttributes In MicroStation V8 XM Edition
      • MDL - Native Code Application Development
      • MDL Or MicroStation BASIC Choosing The Right Tool [TN]
      • MFC Dialog And Native Window Support
      • Microsoft Office VBA Patch Utility
      • MicroStation BASIC FAQ
      • MicroStation BASIC Limits [FAQ]
      • MicroStation Developer Documentation and Example Code
      • MicroStation Programming Advice
      • MicroStation SDK
      • MicroStation V8 Programming Tools Readme
      • MicroStation V8 VBA Programming Resources [CS]
      • MicroStation V8 XM Edition View Code Updates
      • MicroStation VBA Resources Revisited [CS]
      • Migrating Dimension Code To MicroStation V8
      • Migrating MDL Applications To Native Code
      • Mouse Wheel Events And The Visual Basic 6.0 IDE
      • Porting MDL Applications To MicroStation V8
      • Reading Elements From A Microsoft Access Database With VBA [CS]
      • Running MDL Applications
      • Scanning For MicroStation V8 Elements In VBA [CS]
      • Unleash A Workspace Wizard Automating Workspace Creation With MicroStation V8 And VBA [CS]
      • Using VBA To Detect The Current Or Last Used Command
      • Using VBA To Programmatically Export A VBA Project [CS]
      • Using VBA To Programmatically Import A VBA Projects Components And References [CS]
      • VBA -- Creating A Complex Application
      • VBA Interface Error: failed creating the comp manager - 0x80040583
      • VBA interface error: unable to get IDE
      • vba recording
      • Working With Levels In MicroStation VBA [CS]
      • Writing An MDL Application To Output Custom Placemarks To Google Earth
      • [V8i C++] PointCloud IPointCloudChannelDisplayHandler
    • +Visualization Wiki

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

    MicroStation BASIC FAQ

       
      Applies To 
       
      Product(s): All
      Version(s): See Important Note below
      Environment:  N/A
      Area:  N/A
      Subarea:  N/A
      Original Author: Bentley Technical Support Group
       

     

     

     

     

     

     

     

     

    Important Note:

    In MicroStation V8, Microsoft's Visual Basic for Applications (or VBA) was introduced.
    Although there are some similarities in concepts between MicroStation BASIC and VBA, Bentley HIGHLY recommends using VBA and not MicroStation BASIC in any MicroStation V8 version.
    For more information on the use of VBA, see:
    https://communities.bentley.com/products/microstation/w/microstation__wiki/15465/vba-programming-microstation

    What is MicroStation BASIC?

    MicroStation BASIC is a tool to allow you to drive MicroStation. The BASIC program can select tools and view controls, send key-ins, and modify elements using the tools provided.

    What can I do with MicroStation BASIC?

    The goal of MicroStation BASIC is to allow you to automate many activities which you can perform interactively in MicroStation.

    What Bentley products support MicroStation BASIC?

    MicroStation BASIC was first available in MicroStation PowerDraft. MicroStation also includes BASIC. Any platform which supports these products will have BASIC available.

    Do I need MicroStation or MicroStation PowerDraft to run a BASIC program?

    Yes, MicroStation BASIC is part of the MicroStation environment.

    Do I have to use the MicroStation BASIC editor?

    No, the input files for MicroStation BASIC are ASCII files. Any Text Editor can be used to edit them. You can use the MicroStation BASIC Editor for debugging.

    How do I start a macro from the MicroStation command line or Key-in Field?

    Use the command Macro followed by the macro name.

    macro widget

    If the macro does not reside in the directory(s) specified by MS_MACRO then the full path must be used.

    macro c:\MyMacros\MyWidget

    A macro name can be specified two ways, widget.ba or widget.bas. If the .ba file extension is used, the BASIC program will not be recompiled. If the .bas file extension is used, the BASIC program will be recompiled if the source file has been updated since the last compile.

    How do I start a macro with the debugger from the command line?

    Use the command Macro with Debug followed by the macro name.

    macro debug Widget

    How do I recompile the application for other platforms?

    MicroStation BASIC programs are platform independent. Copy the .ba in the same way you would a DGN file to the target platform. The source file .bas does not have to be copied. If both files are present and the source has changed, the compile happens automatically.

    How do I run a MicroStation BASIC program as a start up macro?

    An MDL application RunMacro is supplied in the MDL examples directory. This application will look at configuration variables and run a MicroStation BASIC program(s) as MicroStation starts. For more information on RunMacro, see \ustation\mdl\examples\runmacro\readme.txt.

    What is Macro Record/Edit/Playback?

    This question has three parts. Macro Record is a way of creating a macro from actions take through the operator interface. The macro recorder generates BASIC code for each recordable user action. Edit is to take a recorded macro and add actions which could not be recorded. Playback of a recorded macro repeats each step recorded. In an unmodified macro there will be no interaction with the operator. All inputs were recorded are played back.

    See Also

    Product TechNotes and FAQs

    MicroStation Desktop TechNotes and FAQs

    https://communities.bentley.com/products/programming/microstation_programming/

    https://communities.bentley.com/products/microstation/w/microstation__wiki/15465/vba-programming-microstation

    External Links

    Bentley Technical Support KnowledgeBase

    Bentley LEARN Server

    Comments or Corrections?

    Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!

     

       

    • MicroStation BASIC
    • Keyins
    • Macro
    • Share
    • History
    • More
    • Cancel
    • Hannah Blye Created by Hannah Blye
    • When: Thu, Jun 26 2008 9:48 AM
    • Henk Ligtvoet Last revision by Bentley Colleague Henk Ligtvoet
    • When: Tue, Feb 6 2018 12:05 PM
    • Revisions: 13
    • 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