I'm just starting out with OpenRoads Designer CE - 2021 version 10.10.01.03. I'm coming from MicroStation, and in MicroStation I had a couple of handy VBA keyins set up, and I'm trying to figure out how to get them set up in OpenRoads or if it's possible. The VBA keyins I used would change the working units to decimal feet or to feet and inches, and I had them assigned to function keys. Here's the keyins I was using:
Change to decimal feet: vba execute ActiveSettings.CoordinateFormat = msdMasterUnits;vba execute ActiveSettings.CoordinateAccuracy = msdAccuracy4
Change to feet and inches: vba execute ActiveSettings.CoordinateFormat = msdSubUnits;vba execute ActiveSettings.CoordinateACcuracy = msdAccuracy16th
These don't seem to work in OpenRoads. Can OpenRoads run VBA through the keyin, and if so where can I find a guide for that or what needs fixed in my command to make this work? If VBA can't be run like this in OpenRoads, is there some kind of shortcut or similarly efficient way I can toggle the working units back and forth without having to go into the settings?
Hi Ryan,
Ryan Beck said:and in MicroStation I had a couple of handy VBA keyins set up
You do not specify what MicroStation version you use, but I am sure it is not CONNECT Edition (as is used ORD), because the key-ins do not work in MicroStation too! It would help to answer your question when you specify the used products better.
Ryan Beck said:and if so where can I find a guide for that or what needs fixed in my command to make this work?
To search for a phrase (e.g. "vba execute") is recommended first step and in such case you find the solution a seconds, because it was discussed several times already.
Ryan Beck said:If VBA can't be run like this in OpenRoads
Of course it can be used, only in CONNECT Edition the key-in changed, so it is not "MicroStation versus ORD" as you wrote, but "V8i versus CE" versions.
In CONNECT Edition, the right key-in, regardless used product, is "macro vba execute".
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Answer Verified By: Ryan Beck
I'm coming from MicroStation Select series 10.
Jan Šlegr said:To search for a phrase (e.g. "vba execute") is recommended first step and in such case you find the solution a seconds, because it was discussed several times already.
I've spent at least an hour searching the OpenRoads help in the software itself as well as the community forums. I'm not sure what conversations you're referring to, because I have been unable to find them or the conversations I've found have been unable to resolve my issue.
Jan Šlegr said:In CONNECT Edition, the right key-in, regardless used product, is "macro vba execute".
This seems to work, thanks! I was getting an error that I had to load a VBA project first and managed to find help for that on the forum, but after doing so it seems to be executing. Looks like I need to update the command a bit though, it's changing units but not the master units.
I see part of why I had so much trouble now. There's no VBA help in the OpenRoads help file as far as I can see. The VBA help all appears to be in the MicroStation help file, but I don't have MicroStation connect edition, I only have MicroStation select series 10, not connect. To see the VBA help I went to this link and clicked on the latest MicroStation help: Bentley - Product Documentation
I managed to figure out that the help file is pointing me to a file in the ProgramFiles directory named "MicroStationVBA.chm". After doing a search in the OpenRoads directory I was able to find "vba_concept.chm" which appears to be the relevant help file for VBA. After finding that I found info about the object browser in the visual basic application window (View>Object Browser). From searching around in there I found that the MsdCoordinateFormat options are the same as before (msdMasterUnits, msdSubUnits, msdWorkingUnits). But for whatever reason the behavior of msdSubUnits seems different than how it worked in MicroStation select series 10. In that program it would set the working units format to MU:SU, in OpenRoads though it seems to just set that dropdown to blank, and my measurements are all in inches and ignore the master unit. But using msdWorkingUnits seems to work. Unfortunately I have no idea why, I don't see any documentation of what these are actually doing.
Anyway, I'm writing all this here in case it help anyone else. It seems like an oversight to me that the OpenRoads help file doesn't have info about VBA like the MicroStation one does, that led to a lot of confusion for me.
Ryan Beck said:There's no VBA help in the OpenRoads help file as far as I can see.
I am not sure where and how did you look, but it is not right.
I searched for *.chm in OpenRoads folder and quickly identified VBA help in "C:\Program Files\Bentley\OpenRoads Designer CE 10.10\OpenRoadsDesigner\MicroStationVBA.chm"
Ryan Beck said:But for whatever reason the behavior of msdSubUnits seems different than how it worked in MicroStation select series 10.
I recommend to follow the best practices and to ask in a new post, because this one is about another issue.
It is probably better to use Civil Programming forum, not this "user one".
Regards,
I think the point is that a user shouldn't have to resort to searching their hard drive for help documents. An ORD user should also not have to decipher which tools are ORD- or MicroStation-specific when Bentley told them that that ORD includes all of the tools from MicroStation that they need for design and plan production. If not included within the ORD help, there should at least be a clear link directly to these tools from the ORD help, not some generic Product Documentation page (which may or may not have help for their specific version).
I could go on for awhile but I'll leave it at that.