Hi,
we're currently in the process of migrating our ACAD extension to the newly released 2019-version of AutoCAD.
We have a partial CUI, which contains a custom workspace with some custom PopMenus and Toolbars. At first start of our product, this workspace gets copied programmatically to the main customization file, which is currently loaded (usually ACAD.cuix). This worked nearly flawless since ACAD 2012, sometimes minor tweaks were neccessary, but nothing overly problematic.
With ACAD 2019, we have an issue with the toolbarbuttons within in the toolbars. They are always shown with '?'-icons, although there are images defined for those buttons in the CUI:
Toolbars, as shown initially directly after start:
I figured out the icons are displayed correct, when I toggle the visibility of the toolbar through context-menu:
Toolbars after toggling visibility state:
Unforunately, this toggling seems to be neccessary after each new start of AutoCAD.
I already tried to do this toggling programmatically, but it does not work:
public void ToggleGIPSToolbars() { string menuname = AcadApp.GetSystemVariable("MENUNAME").ToString(); var cs = new CustomizationSection(menuname); cs.Workspaces.BeginUpdate(); foreach(Workspace item in cs.Workspaces) { foreach(WorkspaceToolbar wkToolbar in item.WorkspaceToolbars) { if (wkToolbar.Display == 0) continue; wkToolbar.Display = 0; wkToolbar.Display = 1; } } cs.Workspaces.EndUpdate(); }
Is this a known issue or are there any known workarounds?
Thank you very much.
Best regards,
Matthias
Thank you for reporting.
Can you please share with us a reproducible sample, we can report to Engineering ?
Hi Deepak,
We also facing this issue.
We have a old CUIX(working fine with AutoCAD 2018) file, where Icons are getting loaded on the fly from the DLL with the same as CUIX file.
It does generate mnr/light_mnr file, however when launching AutoCAD 2019 again. The icons are missing from the toolbars.
But the same icons can be seen there on Menus
Thanks,
Sachin
Hi deepak,
I attached a zipped ACAD.cuix, which contains our custom workspace (named GIPS) with the malfunctioning toolbars (i.e. GIPS:Bearbeiten).
You can reproduce the issue, when you load the CUIX with the _menu command.
Please consider, that after switching to our workspace, it seems that the icons are working, because the always work after switching workspaces. To reproduce, please switch to our workspace, close & restart AutoCAD, so it does use the last workspace automatically at startup, without initial switching; you then see, that the icons are missing.
Best regards,
Matthias
Thank you for sharing and reporting the issue.
We have escalated the issue with the Engineering team.
Here's some quick code I've been using to fix this issue until Autodesk fixes it.
(defun fixmenus (menus / dir file m mg mgs o) ;; RJP - 03.30.2018 (vl-load-com) (cond ;; If AutoCAD 2019 ((= 23 (atof (substr (getvar 'acadver) 1 4))) (vlax-for x (setq mgs (vla-get-menugroups (vlax-get-acad-object))) (setq mg (cons (list (strcase (vla-get-name x)) (vla-get-menufilename x) x) mg)) ) (foreach menu menus (cond ;;Menu loaded, unload then reload ((and (setq m (assoc (strcase menu) mg)) (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-unload (list (last m))))) (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-load (list mgs (cadr m))))) ) ) ) ) ) ) (princ) ) ;; Usage - list of menus to reload (fixmenus '("MenuName1" "MenuName2"))
We didn't find any until today. Maybe you can try to switch to another workspace (one of the standard workspaces) and back programmatically. This definitely works when done by the user in AutoCAD, but will be an ugly solution, since it causes flickering of the UI.
Please provide us information on if and when Autodesk will provide a fix for this issue.
As an interim workaround, you can try this:
using System; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.Runtime;
[assembly: ExtensionApplication(typeof(Project1.MyApplication))] namespace Project1 { public class MyApplication : IExtensionApplication { public void Initialize() { Application.Idle += idle; } void idle(object sender, EventArgs e) { Application.Idle -= idle; Autodesk.AutoCAD.Internal.Utils.ReloadMenus( (string) Application.GetSystemVariable("WSCURRENT"), false, true); } public void Terminate() { } } }
Oops. Wrong API.
This is what it should have been:
using System; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.Runtime; namespace Project1 { public class MyApplication : IExtensionApplication { public void Initialize() { Application.Idle += idle; } void idle(object sender, EventArgs e) { Application.Idle -= idle; Autodesk.AutoCAD.Internal.Utils.SetCurrentWorkspace( (string) Application.GetSystemVariable("WSCURRENT"), false, false); } public void Terminate() { } } }
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties
internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties
Can't find what you're looking for? Ask the community or share your knowledge.