Named Expressions - Want to Show and Hide Menus Based upon Starting Characters of Active File Name

We use a DOT provided workspace which uses VBA to load various Barmenu files. The Macro reads the file name and grabs the initial three characters and loads the MDF files based upon what it finds.

I would like to migrate that to named expressions with menu customizations that use a show and hide toggle based upon the named expression. This seems like a natural progression since we can import the Barmenu files using one of the Bentley utilities.

This will be my first venture into Named Expressions, so I am looking for any suggestions or caveats that may burst my bubble.

TIA.

Parents
  • Thanks, Jan.

    Sometimes, us "old dogs" find it hard to find the time to learn new tricks. Bentley keeps adding capabilities but often we are tied to a client version or standard and if they are not using the newer capabilities, its hard to justify working on them or with them or even learning them until the client decides how they want it used.

    You info is concise and clear and not only gives me encouraging news but also those basic first steps.


    Charles (Chuck) Rheault
    CADD Manager

    MDOT State Highway Administration

    • MicroStation user since IGDS, InRoads user since TDP.
    • AutoCAD, Land Desktop and Civil 3D, off and on since 1996
Reply
  • Thanks, Jan.

    Sometimes, us "old dogs" find it hard to find the time to learn new tricks. Bentley keeps adding capabilities but often we are tied to a client version or standard and if they are not using the newer capabilities, its hard to justify working on them or with them or even learning them until the client decides how they want it used.

    You info is concise and clear and not only gives me encouraging news but also those basic first steps.


    Charles (Chuck) Rheault
    CADD Manager

    MDOT State Highway Administration

    • MicroStation user since IGDS, InRoads user since TDP.
    • AutoCAD, Land Desktop and Civil 3D, off and on since 1996
Children
  • Hi caddcop,

    Unknown said:
    Sometimes, us "old dogs" find it hard to find the time to learn new tricks.

    Tell me about it :-)))

    I remember I delved into Named Expression some time ago mainly because a user asked me for help and at the same time I was interested how this system can be extended with own Symbol Sets.

    Unknown said:
    or even learning them until the client decides how they want it used.

    That's true for sure.

    Named Expressions look a bit weird for the first sight, but if you understand one, you will probably be able to understand all. An important thing is to know what different Symbol Set do, so I recommend to spend a few minutes with Symbols Report (dialog Named Expressions, menu Utilities > Report Symbols). Another good source of information are Named Expressions delivered with MicroStation dgnlib, because they are widely used in MicroStation GUI (typically they drive local context mouse menu), as you can see in Workspace > Customize dialog.

    To control MicroStation GUI is the most important and probably the most straightforward usage of Named Expressions. But don't forget it's possible to create own Symbol Sets with own functionality.

    Crossing my fingers,

      Jan

  • Another example:

    I have a custom menu that includes some AECOsim tools that I don't want to see when I use the menu in either ABD's MicroStation Mode or vanilla MicroStation.

    ABD has a whole set of Named Expressions prefixed BD_. They don't appear in MicroStation mode so the first point to note is that the BD_ named expression that I need must be copied into the dgnlib containing the menu so it is always available.

    The expesssion I need isn't quite there. I only want to see the menu when the Building applications are loaded.

    There are BD_IsAppLoaded... expressions for individual disciplines so I copied:

    BD_IsAppLoadedArch

    to:

    Local_BD_IsAppLoadedABD (in the dgnlib)

    BD_IsAppLoadedArch contains the Expression:

    Session.EvalCExprAsInt("BDesignerSettings.isAtfLoaded", "DESIGNER")=1

    By adding the similar expression for the other three diciplines with OR statements I get:

    Session.EvalCExprAsInt("BDesignerSettings.isAtfLoaded", "DESIGNER")=1
    OR
    Session.EvalCExprAsInt("BDesignerSettings.isEtfLoaded", "DESIGNER")=1
    OR
    Session.EvalCExprAsInt("BDesignerSettings.isHtfLoaded", "DESIGNER")=1
    OR
    Session.EvalCExprAsInt("BDesignerSettings.isStfLoaded", "DESIGNER")=1

    This expression is the Show/Hide Test for each of the menu items. If the result of any one of these is True then the menu item is shown.

    They take a bit of getting used to but are very handy once you do.

    Regards

    Marc

  • What exactly does this mean?

    Unknown said:

    There are BD_IsAppLoaded... expressions for individual disciplines so I copied:

    BD_IsAppLoadedArch

    to:

    Local_BD_IsAppLoadedABD (in the dgnlib)

    And how or why is it needed?


    Charles (Chuck) Rheault
    CADD Manager

    MDOT State Highway Administration

    • MicroStation user since IGDS, InRoads user since TDP.
    • AutoCAD, Land Desktop and Civil 3D, off and on since 1996
  • To hide the ABD specific tools I needed a named expression that would test for the presence of ABD. ABD has it's own set of Named Expressions that do not exist in MicroStation They included:

    • BD_IsAppLoadedArch
    • BD_IsAppLoadedElec
    • BD_IsAppLoadedMech
    • BD_IsAppLoadedStr

    that check which of the four disciplines is loaded.

    I wanted one that would show my menu items when any of the disciplines were loaded so created a new named expression that included the expressions from all four of the above.

    The new expression is stored in the dgnlib that contains the menu so it travels with the menu.

    Regards

    Marc