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 Children
  • I highly recommend that you convert things to VBA over Basic.  I have never tried this so I do not know how successful it will be, start the VBA recorder and then run the UCM it should record the playback of the UCM depending on how complex, it may help you get what you need.

  • There's an mdl to convert ucm's to basic. That will give you a start. Why not post some of the ucm's to see if soomeone has a program that will work or can be easily modified to do the job ?

  • Thank you for your suggestion, but the Illustrators have been using Microstation Version Version 05.07.01.22 Windows XP for many years and they are running the UCM Macros there. This version does not run VBA.

    The Illustrators are required to move to Windows 7 and use Microstation Version V8i [SELECT series 3] - Version 08.11.09.357 as soon as possible. The Microstation Verson V8i won't accept UCMs.

  • Thanks. What is the name of the mdl to convert UCMs to Basic? I'm pretty sure I can't post anything online from work.

  • From looking at the Forum, I thought there was a good chance that I would be told not to use Basic - instead of answering my question. Although, I really understand why you are saying not to convert to Basic after trying to work with it for awhile. I will take a look at converting one of the UCM Macros into Basic and see what's involved.

    In the meantime, is this correct that Macros can't be called with parameters from a Basic Macro?

  • Unknown said:
    I'm pretty sure I can't post anything online from work

    UCMs are pretty much write-only code.  There aren't too many people around who understand them.  One approach would be to document their functionality, and re-implement that functionality in whatever language.  That process may also reveal that some UCMs written for older versions of MIcroStation have been superseded by the functionality provided by newer versions of MicroStation.  In other words, some of your UCMs may be redundant.

    Unknown said:
    I thought there was a good chance that I would be told not to use Basic - instead of answering my question

    As you have discovered, UCMs are obsolete in MIcroStation V8i.  There's a good chance that BASIC will also go the way of the Dodo in a future version of MicroStation.  BASIC does not support all features of MicroStation; in contrast, VBA comprehensively supports MicroStation.  VBA is implemented also in commonplace products such as Word and Excel: consequently you can solicit help from people outside the MicroStation community.

     
    Regards, Jon Summers
    LA Solutions

  • 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

  • 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.