Named Expressions (IsMdlDialogOpen)

When using Named Expressions how can I find out a dialogs ID, example below.  Looking for the "Choose Element - Element Selection" dialog ID.

Session.IsMdlDialogOpen(-7, "REF")

Parents Reply Children
  • Yes this is the dialog, looks like the name may be somewhat different in your version.  I used the dmsg dialogbug on, lots of numbers but nothing seemed to uniquely identify this dialog.  It appeared to be 79 but then I also see others that have that same numbers, this dialog seems to be one that changes according to selected tools so it may be difficult.

    948 Dialog hook resize: Element Selection, "PSELECT" 'dBox'=-79
    949 Dialog hook update: Element Selection, "PSELECT" 'dBox'=-79

    932 Dialog hook resize: Place SmartLine, "SMRTLINE" 'dBox'=-79
    933 Dialog hook update: Place SmartLine, "SMRTLINE" 'dBox'=-79

    Mike Longstreet
    Vermont Agency of Transportation
    Civil Engineering Technical Support
    VTCAD Help

  • Hi Mike,

    Unknown said:
    It appeared to be 79 but then I also see others that have that same numbers

    Yes, it's correct, because it's exactly how MicroStation GUI is designed from ... hmm ... version 4.0 :-)

    With some level of simplification, it works in such way tools don't have own dialogs, but they have only defined set of GUI items. MicroStation maintains one common dialog called Tools Settings window, which has no own content, but active tool fills this window with a specific content. So from outside there is still one dialog, but its content is changed whenever another tool is started.

    What do you want to achieve using this Named Expression?

    With regards,

      Jan

  • I am attempting to add "Show/Hide Test" to  "Context Menus", the menu items I created should only show when MicroStation is in the tool setting "Element Selection" mode, but not necessarily having elements selected,  just in the element section mode.

    Mike Longstreet
    Vermont Agency of Transportation
    Civil Engineering Technical Support
    VTCAD Help

  • key-ins:

    • expression show toolboxes
    • expression show dotnetdialogs

    Will display the IDs you are looking for.

    The existing named Expression 'Session.ActiveCommandKeyin()' will return the key-in command of the currently active tool, e.g. CHOOSE ELEMENT

    Whether you can use these to show/hide when the selection tool is selected but without an active selection I'm not sure.

    I thought this one might work but it just returns True, there may be a way of building on it...

    Session.EvalCExprAsBool("Session.ActiveCommandKeyin()", "CHOOSE ELEMENT")=False

    If you are willing to have an active selection, then 'Selection.IsActive()' works without further ado.

    Marc

    Answer Verified By: Mike Longstreet 

  • I did get this to work after some testing with your seggested expression.  The one that worked for me seem to be

    Expression = Session.ActiveCommandKeyin()="CHOOSE ELEMENT".  This is actually a delivered Named Expression named "IsSelectionTool"

    Mike Longstreet
    Vermont Agency of Transportation
    Civil Engineering Technical Support
    VTCAD Help

    Answer Verified By: Mike Longstreet