Is there any option to modify the string for a particular key in Function Keys[.mnu] using VBA?
Thank you Jon :)
Unknown said:Is there any option to identify that (present FunctionKey) path?
You'll need this MDL function: mdlFuncKey_currentMenu
Put this declaration at the top of your VBA code …
Declare Sub mdlFuncKey_currentMenu Lib "stdmdlbltin.dll" ( ByVal filename As String )
Use it like this …
' --------------------------------------------------------------------- ' FunctionKeyMenuPath ' VBA wrapper round MDL function ' Returns: String the path to the current function key menu ' --------------------------------------------------------------------- Public Function FunctionKeyMenuPath() As String Dim path As String Const MAX_PATH As Long = 254 path = Space(MAX_PATH) mdlFuncKey_currentMenu path FunctionKeyMenuPath = Trim(Left(path, InStr(path, Chr(0)) - 1)) End Function
Regards, Jon Summers LA Solutions
Hai Jon/Jan,
I think that ActiveWorkspace.ConfigurationVariableValue ("MS_FKEYMNU") will show the default/startup path of function key menu. But the "attached FunctionKeyMenu" path may vary[if the user manually attach/opened a FunctionKeyMenu from another location]. Is there any option to identify that (present FunctionKey)path?
Unknown said:The function key menu is attached using the value of configuration variable MS_FKEYMNU.
Yes, but if I remember right, the varible is used when MicroStation is started, but to load another mnu file from MicroStation, a key-in attach menu <full path to mnu file>,FK has to be used.
So probably the best approach is attach menu and to change MS_FKEYMNU at the same time.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Unknown said:How to get the attached mnu file path using VBA?
The function key menu is attached using the value of configuration variable MS_FKEYMNU.
Dim menuPath As StringmenuPath = ActiveWorkspace.ConfigurationVariableValue ("MS_FKEYMNU")
Thanks Jan and one more question.
For editing the mnu file, how to get the attached mnu file path using VBA?
Hi,
mnu file is a normal text file, so you can modify it using standard text file functions available in VBA.