Hello,
1) To load / unload a CUI file, you may use "acedCmd" using P/Invoke. Here is a sample code :
[DllImport("acad.exe", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, EntryPoint = "acedCmd")]
private static extern int acedCmd(System.IntPtr vlist);
// ....
ResultBuffer rb = new ResultBuffer();
ResultBuffer rb = new ResultBuffer();
// RTSTR = 5005
rb.Add(new TypedValue(5005, "FILEDIA"));
rb.Add(new TypedValue(5005, "0"));
acedCmd(rb.UnmanagedObject);
string cuiFileName = cs.CUIFileBaseName;
//CUIUNLOAD
rb = new ResultBuffer();
rb.Add(new TypedValue(5005, "_CUIUNLOAD"));
rb.Add(new TypedValue(5005, cuiFileName));
acedCmd(rb.UnmanagedObject);
//CUILOAD
rb = new ResultBuffer();
rb.Add(new TypedValue(5005, "_CUILOAD"));
rb.Add(new TypedValue(5005, cuiFileName));
acedCmd(rb.UnmanagedObject);
//FILEDIA
rb = new ResultBuffer();
rb.Add(new TypedValue(5005, "FILEDIA"));
rb.Add(new TypedValue(5005, "1"));
acedCmd(rb.UnmanagedObject);
2) To make a tab visible, you need to set the "ActiveTab" property of the Ribbon Control
Autodesk.Windows.RibbonControl ribControl = Autodesk.Windows.ComponentManager.Ribbon;
ribControl.ActiveTab = <Set the tab here>
Cheers,
Balaji
Developer Technical Services
Autodesk Developer Network
Balaji
Developer Technical Services
Autodesk Developer Network