Hello,
I am new to the Microstation API. I have installed MicrostationSDK V8i and Visual Studio 2008. However when I run the TextMod example it gives me compilation errors. I am presuming that this is because I need to setup my Visual Studio environment for the MicrostationAPI. I would appreciate some help with the following issues:
1) What are the lib files that I need to link to my code and where do I link it in Visual Studio?
2) Is there anything else that I need to do after linking the lib files to my Debug and Release versions?
In short, it would be extremely helpful if you can give me a step by step guide for how to setup Visual Studio for the SDK so I don't get any compilation errors when I try to run an example.
Thanks,
Alex
Alex,
First (just to be sure) Do you have MicroStation V8i installed (along with the MicroStationSDK). If so then you will need to correct the assembly references that are in the project to point to the assemblies that are delivered with MicroStation. Attached is the workshop that I have done in the past to get people started with AddIn development.
HTH,
mark anderson [Bentley]
Visit me at https://communities.bentley.com/communities/other_communities/bentley_innovation/default.aspx
Mark,
Thank you so much for the tutorial.
But I am missing the MicroStationAddInWizard2008.
All the links in the forum to this file have somehow turned into Page Doesn't Exist.
Can you please link me with the appropriate files?
Like I said it was an old class. The wizard files are now all delivered with the MicroStationSDK. You will find them in the VisualStudioWizards sub directory of the examples (MDLProjects/...). Also the instructions for configuring them are in the MicroStation Programmers Guide.help file.
Actually I could not find the wizard files from your previous post. Can you please give me a more detailed direction on how to find them.
Thanks
Where did you install the MDL Examples ? The default location would be under your user name in the My Documents\MDLProjects directory.
I could finally compile the examples TextMod and CellUtility by just removing the references and adding them again (with proper dll files).
However, both examples output a .dll file instead of a .exe files and that makes it slightly difficult for me to understand what the code does ultimately.
Are there any examples that output a .exe file so that I can run it and understand what my code is doing.
Thank you so much!
Maybe you should review some things in the Programmer's Guide. When you build an application for MicroStation we prefer that you use MicroStation as the host system. This means that your application will be a dll that will load in MicroStation's space. If you want to build an application that does not run in MicroStation you simply need to attach to the running MicroStation application and use the COM service that is provided. You can reference the ustation.dll and the MicroStationDGN library to accomplish this. The wizards are there to support MicroStation AddIn development only.
Microstation applications run inside of microstation so they will have a .dll extension (.NET) or .ma extension (MDL).
I assume "understand what my code is doing" to mean to be able to debug (step through) your program. You can do this using Visual Studio.
1. Start Microstation
2.in Vis Studio use Tools>Attach to Process (or Ctrl+Alt+P)
3. select the ustation.exe file.
4. run your command
if you have breakpoints in your code your will be taken to your break points as your program hits them.
Two monitors make this a lot easier, one for Microstation, one for Visual Studio.
NOTE: I don't know if this works in the Express versions of Visual Studio, by default you can't debug dll files in Express. I
In addition what mwrbentley wrote about the debugging, you can even more automate and enhance the debugging process (used in Visual Studio 2008):
These settings ensure, that if you build your MicroStation .NET addin in Debug mode, the final dll will be copied to the specified folder, MicroStation will start automatically with the specified workspace, design file will be opened and MicroStation process (ustation.exe) will be attached to Visual Studio for debugging.
Simply said: Press Build button and you can start debugging :-) ... well, you have to load your application manually, but it can be also ensured using MicroStation variables.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Thank you guys.
I was able to load the CellUtility.dll example and it opened up a windows form with some functionality.
However, I still don't know how to use this CellUtility application (as in does it add cells or manipulate cells in some way). I am going through the code to figure out what it does.
Is there any documentation that describes what these standard examples are supposed to do i.e., how are we supposed to make use of CellUtility, TexMod and other such applications?
Hi Alex,
there is no extra documentation for the SDK examples, but on the other hand - they are "how to write the code" examples, not applications for users, so the code is commented at least. It's not expected you will use SDK examples as normal MicroStation tools, but you will utilize conceptes and code snippets to build you own application.
I agree it's not easy to understant quickly how the code work sometimes, but I think the comments in CellControl.cs provide nice information what each piece of the code does.