I am working with Microstation Connect Update 16 using C# application.
The following sets the premise of my question -
1. Microstation Connect Update 16 is not started yet (I want to start it from my code)
2. Added reference "Bentley.Interop.MicrostationDGN.Dll"
3. Created the Object of Application Class.
4. Calls the "OpenDesignFile()" method on the Application object.
Result
Microstation Connect Update 16 instance starts but shows blank window and no DGN file is opened.
Can you help me, why DGN file is not opening up ?
Thanks
H. S. Matharu
Please refer to my blog article shown as below. Sorry, it is written in my native language -- Chinese. You can easily google translate into your language.
msce c com msce
Sorry, but this does not solve my problem.
I want to open 2 or more Microstation.exe with different DGN opened in each.
Next, for example, I want to add a line int 1 instance, a square is 2, a circle in 3.
All this I want to do in VC++/C#.
Is it possible to achieve the objective ?
Harpreet Singh Matharu said:I want to open 2 or more Microstation.exe with different DGN
At a Windows command prompt:
MicroStation.exe dgn-file-name1 MicroStation.exe dgn-file-name2 MicroStation.exe dgn-file-name3
Harpreet Singh Matharu said:All this I want to do in VC++/C#
If the above works for you, then you can do the same using a programming language. Consult Microsoft web sites to see how to launch an executable with a specified file.
Harpreet Singh Matharu said:Next I want to add a line int 1 instance, a square is 2, a circle in 3
Consult Microsoft web sites to find how to get a reference to a specific instance of a running process.
Regards, Jon Summers LA Solutions
Yes, Jon you are absolutely right and I am able to do it.
The problem is when I draw in the DGN. It always draws in the first opened instance of Microstation, i.e. It always draws in dgn-file-name1.
Where as I want to control the drawing output from my C#/VC++ code, to which instance of Microstation I must draw. The Microstation Application object is always connected to the first opened instance of Microstation.
Harpreet Singh Matharu said:The problem is when I draw in the DGN. It always draws in the first opened instance of Microstation, i.e. It always draws in dgn-file-name1.
Yes, it is how MicroStation works (how MicroStation COM API is implemented).
Harpreet Singh Matharu said:Where as I want to control the drawing output from my C#/VC++ code, to which instance of Microstation I must draw.
This functionality is not available in MicroStation COM API.
I guess it should be possible to search in table of instances, but it's general COM API question, so maybe to use StackOverflow or similar servers helps more.
For me, this issue, plus so many limitations existing of MicroStation COM/Interop API, is serious reason to do not use Interop, but to write code, running inside MicroStation (or to implement own bridge between MicroStation instance and external code).
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Thanks Jan.