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

Loading Partial CUI's at Startup (easyway)

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
402 Views, 2 Replies

Loading Partial CUI's at Startup (easyway)

Ok I've been working on this for the last day to load a partial cui at startup and have the menus and toolbars load. Through all my searches their one no definite way to do this to load menus so I decided to post this to help those who want to do this.


Try
'Load Main CUI Name
Dim mainCuiFiles As String = Application.GetSystemVariable("MENUNAME")
mainCuiFiles += ".cui"
Dim cs As New CustomizationSection(mainCuiFiles)
'set default directory for your custom cui
Dim pwgscCui As String = DEFAULTDIR + "pwgsc.cui"
'Find out the current workspace settings name
Dim ws As String = Application.GetSystemVariable("WSCURRENT")
' check to see if partial cui is loaded
If cs.PartialCuiFiles.Contains(pwgscCui) = False Then
'if your cui isn't loaded it and refresh all workspaces
Application.MenuGroups.Load(pwgscCui)
'refresh current workspace to show toolbars and menu's
Application.SetSystemVariable("WSCURRENT", ws)
Else
'refresh current workspace to show toolbars and menu's
Application.SetSystemVariable("WSCURRENT", ws)
End If
Catch Ex As System.Exception
System.Windows.Forms.MessageBox.Show(Ex.ToString, "ERROR LOADING")
End Try
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

This is covered at http://through-the-interface.typepad.com/through_the_interface/2006/11/loading_a_parti.html
Message 3 of 3
Anonymous
in reply to: Anonymous

Thank you for that post, this was one of the examples that I used but it doesn't refresh the CUI..

This also COM Interop to access the menu API in AutoCAD. I'm using th AcCUI.dll..

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