Is it possible to run a keyin at startup? I saw this AskInga article from 2002 that says one can create a txt file and then point the icon properties to it but I imagine that's pretty out of date by now?
You could also use the autorun.mvba file to run keyins via vb. I use this a lot, very handy.
Is the autorun.mvba a generic file that calls out another key in file? Do i need to write autorun.mvba? I have a complex text file already written for a certain client and would like to just have it run that file via the pcf. It's a pain to try and use this through the shortcut icon.
While It may be possible to have an AutoRun.mvba that called and executed a script, I couldn't tell you howe to do that, exactly.
I have it run my key-ins directly. If you use the one from the links in this thread, you don't have to write it from scratch - you just have to edit it.
Basically, you would load the MVBA through the project manager, highlight it in the list, then click the icon for Visual Basic editor which will open its own window.
You want to edit the Class module of the AutoRun project - it's called "clsDGNOpenClose"
There are two subroutines in this code that you will edit: m_OpenCloseHooks_OnDesignFileOpened and m_OpenCloseHooks_OnDesignFileClosed.These correspond to "commands I want to run any time I open a file" and "commands I want to run any time a file is closed"
You can send input a few different ways, but if you already have your keyins figured out, you would add lines that look like
CadInputQueue.SendKeyin "update fields"
except that my "update fields" would be whatever your keyin string would be. You do need the "quote" marks.
Once you've done that, you Save your updated macro.
To make sure that it runs every time you use MicroStation, you can check the "Autoload" column in the VBA project manager. This will write the file name into your user configuration. Alternately, you can directly edit your configuration (UCF, PCF, etc.) to add the path and name of your MVBA to the MS_VBAAUTOLOADPROJECTS variable
MaryB
Power GeoPak 08.11.09.918Power InRoads 08.11.09.918OpenRoads Designer 2021 R2
Thank you so much!!! This was very helpful and very easy to do. Much appreciated.