Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is There any Tutorial for Microstation Api for C# Developers? [closed]

I am new to Microstation API. I am a C# developer. I need to retrive information from Microstation application using C# application. Is there any tutorial for Microstation API for C# developers?

like image 654
ratty Avatar asked Dec 21 '22 17:12

ratty


2 Answers

If your using Microstation V8i, the following links helped me get started:

  • C# .NET Template
  • MicroStation Add-in: creating the Add In - Another page on this blog have a nice explanation of how to use preprocessor conditionals to be able to use the WinForms.Adapter form class easier.

The target framework needs to be 3.5. 4.0 won't work and will lead to hair loss, trust me. 4.0 can actually be done, but it involves modifying the ustation.exe.config file, as shown here. I think I had another issue with the code from the first link and the second one helped, but I don't remember exactly what that was.

To help testing the add-in, I added a post build command line event to copy the dll to my Microstation folder under the build events tab of the project properties.

Build Events Tab

xcopy "$(TargetPath)" "C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)\MicroStation\mdlapps" /Y

Then I set the start action to be "Start external program:" and set the path to the Microstation executable.

enter image description here

C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)\MicroStation\ustation.exe

This allows me to debug normally with F5. It will compile the dll, copy it, and start Microstation. Still need to key in mdl load MyAddIn from the key-in dialog. I'm sure that could be automated also if I really wanted. Being able to add breakpoints is very very handy.

Goodbye vba and hello source control.

like image 74
xecaps12 Avatar answered Dec 24 '22 06:12

xecaps12


check this: http://communities.bentley.com/communities/other_communities/bdn_other_communities/b/bdn-blog/archive/2011/07/26/learn-microstation-addins-step-by-step-0.aspx

Step by step tutorial.

like image 38
Guanghe Avatar answered Dec 24 '22 06:12

Guanghe