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")
Hi Mike,
dialog IDs are an internal MicroStation thing. You can try to use key-in dmsg dialogdebug on | off | toggle and to catch the proper dialog id in debug list. But I am not sure if this approach is general, I think new NET dialog are not listed there (but have not tried it).
I am not sure what dialog are you interested in. Do you meanTool Settings windows that is opened when Element Selection tool is started (attached) or some other dialog?
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
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'=-79949 Dialog hook update: Element Selection, "PSELECT" 'dBox'=-79
932 Dialog hook resize: Place SmartLine, "SMRTLINE" 'dBox'=-79933 Dialog hook update: Place SmartLine, "SMRTLINE" 'dBox'=-79
Mike LongstreetVermont Agency of TransportationCivil Engineering Technical SupportVTCAD Help
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,
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.
key-ins:
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.
Regards
Marc
Answer Verified By: Mike Longstreet