Load partial cui file

Load partial cui file

Anonymous
Not applicable
1,720 Views
5 Replies
Message 1 of 6

Load partial cui file

Anonymous
Not applicable
Hello!

I try to load my menu at application start. But I can't see this menu in the menu bar after start. I see menu only after I "reload" current workspace in user interface customization dialog. Does have anybody any idea?

const String myCuiFile = @"D:\Visual Studio 2005\Projects\AutoCAD 2008\Cui\sits.cui";

public void Initialize()
{
String currentWorkSpace = (String)Application.GetSystemVariable("WSCURRENT");

CustomizationSection acadCustomSection = new CustomizationSection((String)Application.GetSystemVariable("MENUNAME") + ".cui");

if (acadCustomSection.PartialCuiFiles.Contains(myCuiFile) == false)
{
acadCustomSection.PartialCuiFiles.Add(myCuiFile);

CustomizationSection myCustomSection = new CustomizationSection(myCuiFile);
foreach (Workspace workspace in acadCustomSection.Workspaces)
{
foreach (PopMenu menu in myCustomSection.MenuGroup.PopMenus)
{
WorkspacePopMenu workspaceMenu = new WorkspacePopMenu(workspace, menu);
workspaceMenu.Display = 1;
}
}

acadCustomSection.Save();
}

Application.SetSystemVariable("WSCURRENT", currentWorkSpace);
}
0 Likes
1,721 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
You are changing the CUI file, not the loaded image of it.

You have to do something that causes AutoCAD to reload
the main customization (CUI) file.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5852899@discussion.autodesk.com...
Hello!

I try to load my menu at application start. But I can't see this menu in the menu bar after start. I see menu only after I "reload" current workspace in user interface customization dialog. Does have anybody any idea?

const String myCuiFile = @"D:\Visual Studio 2005\Projects\AutoCAD 2008\Cui\sits.cui";

public void Initialize()
{
String currentWorkSpace = (String)Application.GetSystemVariable("WSCURRENT");

CustomizationSection acadCustomSection = new CustomizationSection((String)Application.GetSystemVariable("MENUNAME") + ".cui");

if (acadCustomSection.PartialCuiFiles.Contains(myCuiFile) == false)
{
acadCustomSection.PartialCuiFiles.Add(myCuiFile);

CustomizationSection myCustomSection = new CustomizationSection(myCuiFile);
foreach (Workspace workspace in acadCustomSection.Workspaces)
{
foreach (PopMenu menu in myCustomSection.MenuGroup.PopMenus)
{
WorkspacePopMenu workspaceMenu = new WorkspacePopMenu(workspace, menu);
workspaceMenu.Display = 1;
}
}

acadCustomSection.Save();
}

Application.SetSystemVariable("WSCURRENT", currentWorkSpace);
}
0 Likes
Message 3 of 6

Anonymous
Not applicable
I know that I have to do SOMETHING to reload .cui file. 🙂 And
I can unload main .cui file, but I can't load it again. I use "cuiload" command, and this command load acadm.cui file from AutoCAD folder, but I need acadm.cui from Documents And Settings folder. Please, help!
0 Likes
Message 4 of 6

Anonymous
Not applicable
glokhov,
did you find a solution to this, I am having the same problem with the menus not showing after the CUI is loaded at startup.
0 Likes
Message 5 of 6

odurier
Enthusiast
Enthusiast

Ok same problem

 

I modify at runtime PartialCui in PrincipalCui.

The change appear in next session of AutoCAD.

 

How say to AutoCAD reload the main cui at runtime.

 

Help Tony Help !!!!

 

0 Likes
Message 6 of 6

jamierobertson1
Enthusiast
Enthusiast
0 Likes