Converting UCM Macros to Basic

For Microstation V8i, I have been given the assignment of converting several UCMs to Basic or Visual Basic. Since there is a manual for converting UCM to Basic, I decided that I would convert them to Basic. Then new macros could be created in VBA. I am just learning Microstation and of course, my management wants this assignment completed quickly.

I would like to know if it is possible to call a Basic Macro from another Basic Macro with parameters of any built-in or Macrostation type, such as an MbePoint.  If not, is there an alternative? These small UCM Macros that are called frequently by many Macros, but I don't think there are include files in Basic.

For now, I'm using Basic Subroutines, which isn't ideal.

I would like to convert the UCMs to VBA, but I think that would take much longer, unfortunately.

Parents Reply
  • What Jon says is all true but that does not help you if you do not know how to program in VBA. If you are already familiar with basic then using it as an interim step may be be your solution while you learn VBA, or better yet, learn MDL. Look for ucm2basic.ma which will convert, with comments included telling you what doesn't work so that you may look for a solution within basic. Most ucm's were quite simple due to the fact that ucm's were highly limited so chances are that a rewrite may not be all that difficult. There are still some of us around that can read and understand ucm syntax. There's also a good chance that someone else has already written something that will work for you or could be easily modified but without access to the ucm's no one would know.

    jchavins@aol.com

Children
  • Unknown said:
    If you are already familiar with basic ...

    Unknown said:
    I am just learning Microstation

    If Elaine is a MicroStation beginner, it's unlikely that she's familiar with a macro language that's unique to MicroStation (that applies equally to UCMs and to BASIC). 

    It's a surreal management belief that someone who is new to a product can simultaneously learn how to customise that product.  Should we suppose that Elaine's manager hires secretarial staff and then instructs them to write Word VBA programs to automate their mail-shots?

     
    Regards, Jon Summers
    LA Solutions

  • Could you provide a sample UCM? That might help with suggestions and ideas of things to do to help you achieve what you have been asked.

    BTW, to add to the suggestions of going straight to VBA, although you may not be familiar with it, it will likely be the fastest way to accomplish what you are looking to do. Further, subsequent maintenance of the customizations will be MUCH easier than dealing with something that is "converted" from one "language" to another and then "converted" to another. I speak from experience there.

    This is not meant to insult, it is merely to provide perspective (from someone who has "been there"...)

      

  • From the MicroStation FAQ.

    Question: Will MicroStation BASIC macros work in MicroStation V8i (SELECTseries 3)?

    Answer: MicroStation BASIC is supported in MicroStation V8i. However, MicroStation BASIC has not been enhanced and is likely to be unsupported in future versions. Bentley recommends migrating existing MicroStation BASIC code to Visual Basic or Visual Basic for Applications.

  • Elaine, the process you are describing is what I consider to be a typical "Migration Project".  There are several options and considerations in the process that should be evaluated before being able to project how long your migration project will take.

    Here are some considerations:

    How has the Product changed?  In your case MicroStation SE (5.7) to MicroStation V8i 8.11 has change drastically in capabiities and workflows.  These points are fundamental in your approach.

    MicroStation V7 had 63 levels and the V7 design file format.  MicroStation V8 has a new format, capabilities, workflows, and nearly limitless levels, models, styles (line, text, dimension), etc.  For one, your UCM unless the most simple will not work in MicroStation V8.  MicroStation BASIC being older also has the similar limitations and both would require several and/or extreme hacks to accomplish something that a more modern MicroStation VBA could handle with ease.  MicroStation VBA has its (smaller) set of limitations, but can be augmented with MicroStation MDL (C/C++ programming language APIs) to enhance VBA, or offer functionality in a stand-alone manner.

    The first part of such a daunting task is to ask some of these questions from the CAD admin/operators:

    1. How many programs are there?

    2. What do they do?

    3. Does the Product NOW offer this functionality?

    4. Have the workflows in the product changed making the older way ineffecient or obsolete?

    5. How many programs do we need to migrate?

    6. Do we only need to migrate some or all the code/featurs of the customization forward?

    7. What programming language(s) are required?

    8. Do I have the experience necessary to perform some or all the work defined as being required?

    9. Can I meet the projected deadlines?

    10. Will I have adequate time to test each app, feature, and (new) workflow and validate everthing is working?

    There are more considerations along the way, but these steps above are generic and apply to any software product that provides customization/programming options.

    I would recommend to evaluate the existing functionality and find it, or find out how to accomplish it in the new product.  Use MicroStation VBA since it is relatively easy to learn and prototype functionality quickly.  TIP: Plenty of sample code in the VBA Help document - Alt F11, F2 (object browser), Search for something - e.g. Cell, then hilite an item displayed in the results and Press F1 - noting "Example" hyperlinks for sample code.  Lastly, if the deadline(s) are imperative I would recomend that you consider contacting our Bentley Profession Services group since they are already fully equipped to handle and meet your customization needs.  Here is some contact information for convenience.

    Bentley Professional Services (BPS) - For Bentley product customization services

    Web:  www.bentley.com/.../Bentley+Professional+Services

    E-mail:  bentley.consulting@bentley.com

    Wish you the best in your efforts and please make sure to use the Be Communities to help you find your way and help with any specific programming questions you may have.

    HTH,

    Bob



  • I was unable to find ucm2basic.ma. I looked in the directory where the ma files are for the older version of Microstation. Awhile ago I had read online that there was a bat file called ucm2basic that Bentley could provide and I called them. But they told me that this was no longer available.