Hello,
I want to load a partial cui.
I used this line of code but it doesn´t work in my case;
doc.SendStringToExecute("_.cuiload " & FileCui & " ", False, False, False)
If this code is launched with a command or loaded on startup without scrips it isn´t problem. The menu is loaded correct.
In my case the application is loaded with a script, "script.scr". This file has some commands to launch when autocad is start;
netload "D:\MyApplication.dll"
ribbon
toolpalettes
menubar 1
In this case the partial menu is not loaded, so i am finding another solutions.
Now i wan´t to load menu with autocad libraries. Like this;
Private Sub LoadCui(ByVal fileCui As String) Dim mainCuiFile As String = "" Dim cs As CustomizationSection = Nothing Dim csPartial As CustomizationSection = Nothing Dim workspaceMenu As WorkspacePopMenu = Nothing mainCuiFile = Application.GetSystemVariable("MENUNAME") & ".cuix" If System.IO.File.Exists(mainCuiFile) Then cs = New CustomizationSection(mainCuiFile) If cs IsNot Nothing Then cs.PartialCuiFiles.Add(fileCui) If (cs.IsModified) Then cs.Save() End If End If cs = Nothing End Sub
The menu is loaded but it does not displaied. why?
Thanks,
Ane
When you say "menu", do you mean the actual Menu (text strip at the top of the application window), or the CUIx file? If the former, whatever UI elements are displayed/hidden and where they are located are controlled by the active workspace. A partial CUIx can be loaded but if the workspace doesn't include the UI elements then they aren't displayed.
There's a setting that can automatically add Ribbon panels to a workspace when a CUIx is loaded but I don't think there is a similar option for Menus.
Try moving that code to when AutoCad closes Like IExtensionApplication. Terminate and change AddPartialMenu to RemovePartialMenu.
During loading try Application.LoadPartialMenu instead.
Hang for sec reminded of something to google
Here you go
http://adndevblog.typepad.com/autocad/2012/07/unload-partial-cuix-when-autocad-quits.html
I want´t to load a CUIx file that have an aditional menu (text strip at the top of the application window).
The CUI is loaded but elements are hidden. I can´t display them.