Edited to add: I've tracked the below down to occurring only when MS_DGNAPPS = RUNMACRO is set, regardless of whether MS_DGNMACROS is set or not.
Another discovery: This actually happens if MS_DGNAPPS variable EXISTS. Even if it's set to nothing. Which I think means I can't actually fix it for anyone else without a complete overwrite of the .ucf file. Is there any way to save an "ActiveWorkspace.RemoveConfigurationVariable" command like there is with an "AddConfigurationVariable"?
I thought this was related to a conflict between a local custom menu/toolbox (.dgnlib with .r01), but even after deleting these entirely, removing all user preference files and configuration variables that point to them, and taking the steps in the Wiki entry below to restore Microstation Powerdraft to defaults, the problem persists.
(I ran this as admin, but note other users on our site will not be able to do so): https://communities.bentley.com/products/microstation/w/microstation__wiki/8671/restore-microstation-to-factory-defaults
This error appears when selecting Tools... Geographic. Menu entry #1 is missing entirely. I am not familiar with the tool that belongs there and do not think we even use it. One user reported that he first saw this after running a macro and following that, when he would attempt to place text it was significantly offset from his cursor, but I have not been able to replicate that.
We have several versions of Microstation Powerdraft v8i installed throughout the company, which may or may not have had the menus working correctly - many people had no macros installed or did not know how to use them.
I have SS1 Version 08.11.07.172 and SS2 08.11.07.443 installed on Windows 7, and both have this issue. The user who brought it up to me is using SS1 Version 08.11.07.172 on Windows 10.
I do not seem to have the menu options shown in the first wiki link above which list the Icon ID. There is no "Application- Tool Reference" menu
Is there anything else I can try to resolve this, since it persists even after removing the .DGNLIB and config variables referencing it? I cannot reinstall Powerdraft for all users, but I can push any files or settings which don't require admin access to all users, such as a repaired .dgnlib or user config variables.
Scott Clarke said:Is there anything else I can try to resolve this
Your screenshot shows a key-in starting with macro. That starts a MicroStation BASIC macro named profilemacro.
A BASIC macro has a .bas extension when editing, and compiles to a .ba file. Does profilemacro.bas or profilemacro.ba exist on your computer or in any folder specified by MS_MACRO?
Regards, Jon Summers LA Solutions
That macro does exist, and it works. It turns out that even removing the dgnlib entirely and resetting to defaults, then reconfiguring without custom menus did not fix it; PowerDraft breaks when MS_DGNAPPS is set true.
My only guess, which is a complete shot in the dark far beyond my level of expertise, is that MS_DGNAPPS may share a namespace with VBA applications and conflict with OnProjectLoad, or some other function/variable I have defined as public.
I've solved the problem for now by adding a function in my OnProjectLoad to call the old MS_DGNMACROS. I may actually experiment to see if it hurts anything to just handle the MS_DGNMACROS list directly, because I don't want to remove the ability for users to run macros of their choosing.
Scott Clarke said:MS_DGNAPPS may share a namespace with VBA applications
MS_DGNAPPS is a configuration variable that specifies one or more MDL apps. to load when you open a DGN file. VBA macros live in one or more folders specified by configuration variable MS_VBASEARCHDIRECTORIES. That's it! It's not clear what you mean by 'share a namespace', but it's easy to find out by performing an MSDEBUG.
Scott Clarke said:That macro [profilemacro] does exist, and it works
So you can eliminate that BASIC macro as the source of the error message. What else in your list of BASIC macros or customised workspace has a dialog or toolbox?
Once I removed all the customizations by deleting the folder with the .dgnlib, deleting the folder with the .BA macros, removing the .dgnlib from the configuration variables, and all MS_DGNMACROS from the configuration variables, I am fairly sure nothing does have a dialog or toolbox.
One of the VBA macros has a form. As far as I know that's working too, because nobody has complained and it's one of the few that are completely necessary for some workflows.
Scott Clarke said:One of the VBA macros has a form
A VBA UserForm is a Microsoft product and is very different from MicroStation development tool products. There would never be an error message about MGDSHOOK emanating from a VBA macro.