[MSCE 10.16 C#] How to get actual config variable value instead of expanded value

MicroStation sets the default value of the MS_REPORT_OUTPUT variable to $(_DGNDIR).

When I use the following code to read the variable: string ReportLocation = ConfigurationManager.GetVariable("MS_REPORT_OUTPUT");

I get the actual disk location of the active file, is there a way to get the non-expanded value? I'm writing an addin for reporting and I have to use keyins to kick off the report and I want to set the location by changing the variable then setting it back to the original before I exit the addin.

Below is quick code test:

 string ReportLocation = ConfigurationManager.GetVariable("MS_REPORT_OUTPUT"); //returns expanded value (the physical file location), not the value of the variable
 ConfigurationManager.DefineVariable("MS_REPORT_OUTPUT", @"C:\temp");            //set location I want the report generated (just a test location for now)
 Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp.CadInputQueue.SendCommand(@"reports export ""Untitled\piertest"""); //run report
 ConfigurationManager.DefineVariable("MS_REPORT_OUTPUT", ReportLocation);  //reset the variable back to it initial non-expanded value

Parents Reply Children
No Data