We have a couple of visual basic programs where we call up microstation to create drawings. For some reason when we run these programs, all of the toolbars that were open and docked are closed. Does this happen to anyone else? Is there a way to prevent that from happening?
Hi Beyondo,
I have not seen such behaviour yet, so I have no solution right now, but I'd like to ask for a few things to better understand the situation:
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
A few more things in addition to what Jan asks...
Our visual basic program is written using Visual Studio 2010. It runs stand alone, outside of Microstation.
The program (shown below) calls microstation to open a file, edits something and then closes microstation.
The next time microstation is started by the user, all the toolboxes have been closed.
The code for our main program is fairly comprehensive, so attached is a zip with a simple version, to find and replace text, which we tested and it does the same thing regarding toolboxes.
On the form:
The first box is the path, it will search for a file named, \test.dgn .
The second box is text you are searching for, so you need 1 line of text.
The third box is text you want to change the text to.
That's it.
Also included in the zip is a couple of screen shots of microstation, showing toolbar/boxes before and after.
Microstation VB.zip
This is the simple code:
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.IO
Imports System.Text
Public Class Form1
Public oDGN As MicroStationDGN.Application
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
oDGN = New MicroStationDGN.Application
oDGN.OpenDesignFile(TextBox1.Text & "\test.dgn")
oDGN.CadInputQueue.SendKeyin("MDL SILENT FINDREPLACETEXT,CHNGTXT CHANGE DIALOGTEXT")
oDGN.CadInputQueue.SendKeyin("FIND DIALOG SEARCHSTRING " & TextBox2.Text)
oDGN.CadInputQueue.SendKeyin("FIND DIALOG REPLACESTRING " & TextBox3.Text)
oDGN.CadInputQueue.SendKeyin("CHANGE TEXT ALLFILTERED")
oDGN.ActiveDesignFile.Close()
oDGN.Quit()
End Sub
End Class
Let me know what you think, or if you need something else, Thanks for your time.
-Beyondo-