Configuration file operators

I'm working on modifying some commands in our configuration, and had a couple questions.

I've looked online to better understand what the "$" does within these files. For example:

     MS_CONFIG_DIR: $(MS_CONFIG_DRIVE)Microstation/Config/

I understand that the command line is referencing a previously established variable (MS_CONFIG_DRIVE) but I don't understand what the $ is doing. Is it telling microstation to look for a previously established variable, named after the $ and between the two parenthesis?

I'm also looking to understand the difference between the ":" and "=" within the config documents.

I've seen:

     MS_CONFIG_DRIVE: Y:/

as well as:

MS_DESIGNMODELSEEDNAME = 2D Design

On the surface, it seems like both operators work in a simlar fashion.

More specifically, I was attempting to set up an if / then statement to reference local files if the network drive was unavailable:

     MS_CONFIG_DRIVE = C:/Program Files (x86)/Bentley/MicroStation V8i (SELECTseries)/

     %if exists (Y:/)

     MS_CONFIG_DRIVE = Y:/

     %endif

But first I had tried:

     MS_CONFIG_DRIVE: C:/Program Files (x86)/Bentley/MicroStation V8i (SELECTseries)/

     %if exists (Y:/)

     MS_CONFIG_DRIVE: Y:/

     %endif

Then first example worked correctly, but the second one did not. I would appreciate any advice. Our company no longer employees the CAD guru who set up our files, and I am working to better understand how this all fits together.

Thanks.

  • Hi Adam,

    at first, two notes:

    • Please use Insert > Insert code tool to include "code snippets" (including configuration files, even one row of text) to you text, so they are not displayed as a plain text.
    • Do not ask more questions in one post to ensure it's clear what topic is discussed.
    I've looked online to better understand

    Did you read MicroStation documentation? Configuration concepts, including configuration variables, are described there pretty well in my opinion.

    what the "$" does within these files.

    The $ letter does nothing! You have always to think in a context of complete syntax.

    Is it telling microstation to look for a previously established variable, named after the $ and between the two parenthesis?

    There are two variants used with a substantial difference:

    $(<CfgVarName>)

    evaluates the variable value every time when the definition is used, whereas

    ${<CfgVarName>}

    evaluates the value once only (when the configuration file is processed).

    See the syntax definition in MicroStation documentation for more details.

    I'm also looking to understand the difference between the ":" and "=" within the config documents.

    Again, it's well described in MicroStation documentation, so I think it's not necessary to repeat the description here.

    Then first example worked correctly, but the second one did not. I would appreciate any advice.

    Without knowing context (which here means to see the full debug log file), it's hard to say.

    But I guess, because ":" is a condition assignment, the variable was defined already, so no new value was assigned.

    I am working to better understand how this all fits together.

    At first, study MicroStation documentation. Without understanding what is written there, "to try something" is just a time wasting effort leading to confusion only.

    With regards,

      Jan

  • Hi Adam,

    The sequence is to check if the network is present, then fail over to the local:

    %if exists (Y:/)
         MS_CONFIG_DRIVE = Y:/
        %else
        MS_CONFIG_DRIVE = C:/Program Files (x86)/Bentley/MicroStation V8i (SELECTseries)/
     %endif

    The $ operator expands the contents of the brackets in the two cases Jan illustrates, it does this only in the context of brackets.

    You might find some of my blogs helpful reading if you are left picking up after your former colleague: 

    CONNECT Edition - Configuration Tips

    Site Standards

    Supporting Techniques

    Note that CONNECT Edition configuration is a bit different to V8i, but ultimately easier to work with.

    Regards

    Marc

  • Adding to what everyone else has also mentioned I would use a different variable name than MS_CONFIG_DRIVE

    This is a custom variable that you have defined, not one that MicroStation recognizes natively. To avoid confusion as to which variables are native MicroStation variables and which variables are your custom variables do not use the MS nor USTN prefix for your variable names.