In its current form, from my tests so far and chatting with BSI Support, in the MS Configuration read/load phase at application start-up, the config variable '_WorkDir' is populated at the beginning of configuration read. It appears to be populated by the short cut icon, or when double-clicking the application.
However, _DGNFile and _DGNDir are not populated until the resolve phase of configuration loading, when the application interface/runtime starts.
I've debugged many times to try and make configuration logic decisions work at the read/load phase of configuration to no avail until I discovered the reason.
I have a sample debug command line to use in a Windows Shortcut icon.
It pre-loads a selected CAD file.
"C:\Program Files\Bentley\MicroStation CONNECT Edition\MicroStation\microstation.exe" D:\CAD\ Test_Files\Test_File.dgn -DEBUGFILEOPEN=5
Check the msdebug.txt to find _DGNFile, _DGNDir, they are both Null values.
But when looking at the variables from inside the application, they are both populated.
My change request is to attempt to have _DGNFile and _DGNDir populated at the beginning of the Configuration read phase so the variables can be used in logic decisions during configuration read/resolve phases.
Is this doable?
Hello,
To follow up regarding this idea, if the pre-processor is going to be able to read the full file path from device or cloud to file name and file path so it can be queried in the configuration stage then I think that some of the Configuration Operators need to be updated to account for reading file extensions because at present i don't think they can?
For example the 'ext' would need to be able to see the DGN/DWG/DXF/DGNLIB/CEL file extensions:
MSV8i format: ext($(VARIABLE))
MSCE format: ext((VARIABLE))
The Device 'dev($(variable))' operator would need to be able to read the local device, the cloud data source and the UNC path.
Just to clarify, there are two apparent phases in the MS pre-processor Configuration load.
The Read Phase
The Resolve Phase
[Some variables can be resolved immediately using {squiggle brackets}, the rest are resolved at the end with normal brackets]
The Resolve Phase is where I find that _DGNFile and _DGNDir are not populated.
Those two variables are populated after the Resolve Phase when the executable reads the resolved configuration, and that's when _DGNFile and _DGNDir are populated.
To make use of those two variables earlier I'm requesting them be populated in the Read Phase, if possible?
Seeing that when I double-click a file in Windows the file association already exists [OpenWith Key/MicroStation.exe %1 in Registry]