Hi,
I am new to Microstation API. can any one tell me how to do program for microstation using C# ?
1. what are dll we have to reference?
2. how load the dll in to microstation?
3. how to run command?
4. in Autocad or Bricscad we can load the dll using netload. is there any command like that in microstation?
Hi arularasu,
I am writing a series of Addins blogs 'Learn MicroStation Addins Step by Step' in Chinese and English. You can find them as below:
communities.bentley.com/.../default.aspx
HTH, Yongan.Fu
Hi Yongan,
That's great ! now i am soo clear .But when i type MDL LOAD csAddins in the key-in field and then press Enter,nothing happen ,i cant find the "Hellow World " message.What is the problem .Can u help me out??
Regards
Arul
Certainly. Possible reasons I guess are as below:
1. Is your csAddins.dll under the ...\MicroStation\mdlapps ?
2. Is your MyAddin.cs source code same as below ?
using System;using System.Windows.Forms; namespace csAddins{ internal sealed class MyAddin : Bentley.MicroStation.AddIn { private MyAddin(System.IntPtr mdlDesc) : base(mdlDesc) { } protected override int Run(string[] commandLine) { MessageBox.Show("Hello World"); return 0; } }}
You can also continue to read the debug chapter and find the problem by debugging.
Thank for Quick reply,
ya i made a mistake in csAddins.dll under the MicroStation\mdlapps. now i am getting it right.
ya sure i will continue and come if have problem.......
BTW, I have below note in my blog:
(If your Addins DLL is generated in your specified folder not in this mdlapps folder, you should set configuration variable MS_ADDINPATH to your folder in order to load your Addin correctly from Mstn.)
HTH, Yongan
Can u pl explane the bellow methods....
private MyAddin(System.IntPtr mdlDesc) : base(mdlDesc)
{
}
protected override int Run(string[] commandLine)
Hi yongan,
In your addins blog the method for creating DimensionElement has 3 argument only ,the view(4th argument) is missing. How to creat a view???
arularasu said: private MyAddin(System.IntPtr mdlDesc) : base(mdlDesc) { }
This is the Constructor of your Addin class. The mdlDesc argument is passed by MicroStation Addin Loader to the class (it is MDL Application identifier). You have to do nothing here, but is recommended to create a static reference, so you can access your addin later. This is also the place to activate events for your addin.
arularasu said: protected override int Run(string[] commandLine) { }
This is the equivalent to mdlMain method of standard MDL application. It is executed by MicroStation Addin Loader right after MDL LOAD MYADDIN [COMMANDLINE] command. In general, this function runs your application. The commandLine argument is text passed after MDL LOAD command. It contains optional arguments from user, I marked it as [COMMANDLINE].
Dan
HI Dan,
Thank for quick reply. Is there snoop in microstation like wise in revit.
arularasu said:Is there snoop in MicroStation like wise in revit
There aren't too many Revit users here, let alone developers, so that comparison is meaningless.
Are you looking for a debugging tool?
If you're looking to post trace messages to help your development, you can send messages to the MicroStation Message Center. The Message Center has a Debug option that shows a message that a regular user will not see.
Regards, Jon Summers LA Solutions