.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Load Partial Cui

4 REPLIES 4
Reply
Message 1 of 5
_ane_
1338 Views, 4 Replies

Load Partial Cui

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

 

 

 

4 REPLIES 4
Message 2 of 5
dgorsman
in reply to: _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.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 3 of 5
jeff
in reply to: _ane_

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

 

 

 

You can also find your answers @ TheSwamp
Message 4 of 5
_ane_
in reply to: dgorsman

 

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.

Message 5 of 5
_ane_
in reply to: jeff

 

I readed the post but my autocad version is 2010 and the function Application.LoadPartialMenu doesn´t exist.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost