Hello everyone, I have a question regarding loading custom UCF file during the startup of Microstation CE application(and also OpenCitiesMap/Advanced, OpenCities Map Ultimate).
Back in the days of V8I, there was an option to launch the Microstation with my own UCF file using the command line switch ws_USTN_USERCFG="myFile.cfg"... I made some investigation on this approach in this CE world and found out following :
My question is, how did you guys solve the situation to launch a given application but with your own UCF file? I mean, I was thinking about copying my files into the prefs folder and name them Personal, but that means my configuration will replace everything and maybe sometimes I want to use it without it. Then another problem is that every product has its own folder path, so basically I have to copy my UCF into the correct folder depending on the installed version (and then I also though about what would happen if the directory path changes with some new updates[right now its in Microstation\10.0.0\prefs] - another trouble!).
Or is there a better and easier way to achieve loading selected UCF during the startup?
Thanks for any suggestions.
why are you concentrating on the "user" part ?
you could and still, can load "a configuration" file on startup from the command line.
Timothy Hickman
CADD Manager | CADD Department
timothy.hickman@colliersengineering.com
Main: 877 627 3772|
1000 Waterview Drive Suite 201 | Hamilton, New Jersey 08691
do you mean using the command line switch -wc? I´ve tried that and it resulted in error, like mine cfg file replaced the core cfg that is being used during the loading. or you mean by copying the content of the original .cfg(debug shows that the first .cfg being processed is mslocal.cfg) and add my own statements?
I use the -wc switch quite often, with no problems. One thing to note is that when using that switch the mslocal.cfg is not automatically loaded. Your custom config file specified by the -wc switch will have to do a %include of the mslocal.cfg
Rod WingSenior Systems Analyst
Answer Verified By: Lubo B
Hello, sorry for late response. I found quite a workaround, with macro USTN_WORKSPACEROOT and defining my own Workspaces/NoWorkSpace/NoWorkSet.cfg. It is working the way I want, but it is probably not the right way to do that.
You might be right, including the mslocal.cfg might be the thing im missing.
However, is it possible to use also some kind of generic way to include the proper mslocal.cfg ? In case of different applications (OpenCities Map Advances, PowerView, Ultimate...), they all have different folder structures and places where these mslocals are stored.
Edit: I have tried it and it works, after i included mslocal (with fixed path). Thanks! The remaining subquestion remains though, to retrieve the path of exe that is executed, so i know where to look for mslocal no matter which application is being called.
Edit2: Basically the directories are defined AFTER mslocal.cfg is included, like the path where configuration files are stored
Hi Lubo,
The file where a custom configuration is best defined is "C:\ProgramData\Bentley\<applicationName>\Configuration\ConfigurationSetup.cfg"
You can also define additional statements in the General section of that file, for example:
_USTN_WORKSPACENAME = MyWorkSpace%lock _USTN_WORKSPACENAME_USTN_WORKSETNAME = MyWorkSet%lock _USTN_WORKSETNAME
Which would pre-set WorkSpace and WorkSet.
ConfigurationSetup.cfg is the recommended point at which to start configuration; we do not recommend modifying mslocal.cfg or any other system CFG files.
I will discuss your question with a colleague from the OpenCities product team.
Marc
Hello Marc, thanks for your input!
I found a way to retrieve the path to the product/config/ folder (from registry!). This way, i can refer to the correct mslocal.cfg with my own .cfg file. I was just wondering, if there exists some kind of variable, that is available to me in my own .cfg, that references the directory of the application that is being called (for example MapAdvanced.exe directory etc.). All these paths are defined only after including mslocal.cfg. And I wanted them before the include.
I like this setup more over your ConfigurationSetup.cfg, because I can save my .cfg file whenever I want without modifying multiple files on host machine (just like back in the days of V8I, with possibility to attach our own UCF file). But to be honest, I´m glad you suggested this approach as well, as I didnt know about it before. Now i have another option available, so thank you.
the fact that the MSLOCAL file needs to be included in your custom configuration file is the whole problem.
If Bentley would fix/change this then this whole situation would not be needed.