Help request from a newbie

Good Afternoon.  I'm brand new to the world of Microstation and MDL.  (almost 2 whole months).

I am attempting to write a program in MDL to automate a routine which uses some of the terrasolid products(A third party MDL software).  So far my research has lead me to believe I cannot use VBA to do this.  I have corresponed with Bentley support and was told I needed the following:

*******************************************************************************************************************************

Download MDL Dev tools from WEB:
==============================
from http://appsnet.bentley.com/downloads/default.aspx
Pick Product: Microstation and then click "Search" button,
You should be able to find "MicroStation V8 Programming Documentation/ Examples" and click Download to start.

After you install the above examples/ Documentation, you will be able to access MDL reference Manual and developer guide from
X:\Program Files\Bentley\Program\MicroStation\mdl\docs\*.chm

The V8 development shell is located at Start -> Program -> Microstation -> MicroStation Development Shell

Please try to compile the delivered example such as:
X:\Program Files\Bentley\Program\MicroStation\mdl\examples\basic

***************************************************************************************************************************************

I am running Microstation V8 2004 edition.  I would like to use Visual Studio 2008 to write my MDL program.  However It's here that I run into the ROAD BLOCK! 

I can compile and successully run a basic example provided by Bentley in the developer shell, however each time I open it I get the following error before the prompt:

Visual C++ product directory could not be found.

Set nttools to Visual C++ product directory.

Set LIB and INCLUDE appropriately.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Also, my mdl bin folder does not include the mstndevvars.bat in ..\mdl\bin\which is recommended to use for configuring an MDL development environment.  It is in the jmdl folder though. 

If someone would point me in the right direction I would greatly appreciate it.

Sincerly,

Rachel Marco   

  • Hi all, To anyone who read by plight above, I have worked through the Basic example in the MDL Programmers Reference guide and have learned that an MDL application is comprised of 21 different files. (At least the 'Basic' example is). Does anyone have a suggested order in which to create these files? Are any of them auto generated are do I need to create each one? Many thanks Rachel
  • MDL Development

    I have worked through the Basic example in the MDL Programmers Reference guide and have learned that an MDL application is comprised of 21 different files. (At least the 'Basic' example is).

    • Does anyone have a suggested order in which to create these files?
    • Are any of them auto generated are do I need to create each one?

     

    MDL is a somewhat raw development environment compared to the facilities provided by something like Visual Studio 2008. IDEs like Visual Studio hide some of the complexity of C++ development. It too has a lot of intermediate files that are auto-generated, but in normal use you don't see those files.

    Source files that you write to create an MDL application include:

    • One or more header (.h ) files. They contain #defines, enums, structure definitions
    • One or more header (.fdf ) files. They contain function prototype definitions, and could just as well be .h files
    • One or more implementation (.mc ) files. They contain source code that is compiled to executable binary code
    • One or more resource (.r ) files. They contain resource definitions -- mostly user interface stuff like dialogs & icons
    • One, and one only, make (.mke ) file. This contains the rules that build your application
    The bmake.exe (Bentley Make tool) compiles your source code according to the rules in your .mke file. It creates a number of intermediate files. Usually you consign those intermediate files to a sub-directory where you for the most part forget about them. The MDL linker, invoked by bmake, stitches those intermediate files into the final rachel.ma file, which is usually built in the \MicroStation\mdlapps\ folder.

    MDL development is not for the faint-hearted. It's a little puzzling that you were advised that VBA is not the right tool. Did your advisor provide any concrete reason why VBA is not the right tool?

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Thank you Jon for the information.  It has helped clear up alot of questions. 

    As to your question about VBA not being the right tool for what I am attempting to do......

    We have a routine which interacts with Terrasolid products.  Two of the three we use have public functions which I'm pretty sure I can access through VBA. (TerraScan and TerraModel).  The third product TerraMatch does not have public functions.  It is my belief that for that portion of the routine I will have to open the TerraMatch MDL via my MDL , have the user manually do that portion of the process and then return to my MDL and finish the routine.  My goal is to reduce the time spent performming this particular task. 

    In this particular routine I will be:

    opening TerraScan and reading in a set of points

    Using the display window in TerraScan to set the points to a certain class

    Open TerraMatch

    Perform my tasks in TerraMatch

    save the point file in TerraScan

    Close TerraScan

    Basically the steps above are what I want to accomplish in a loop type fashion, since I will have multiple point files to adjust.

     

    Have a Great Day!  Rachel

  • Automating TerraMatch

    Rachel_985:
    The third product TerraMatch does not have public functions. It is my belief that for that portion of the routine I will have to open the TerraMatch MDL via my MDL, have the user manually do that portion of the process and then return to my MDL and finish the routine.

    It's still not clear what you could achieve using MDL compared to VBA. The lack of public functions is not somehow overcome by using MDL. Private functions will remain private, whatever language you choose for your application. VBA is just as capable as MDL of starting another application: MDL LOAD TerraMatch should do the trick, whether encoded in a VBA routine or an MDL application.

    Once an MDL application is loaded, you can send commands from another application just as you can keyin commands as a user.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions