I've installed my product which loads a few toolpalettes & toolpalettesets. On first start I would like to open the toolpalette to my new toolpalette in code.
I can open the toolpalette by sending "TP" command, but this just opens the palette windo to the last used palette. I cannot figure out a way to 'Activate' or Focus my new toolpalette. I need to SetCurrent on it.
I use the following code to activate the palette from a palette set (where palette points to the instance of the palette I want to activate):
System.Collections.IEnumerator paletteEnum = palette.PaletteSet.GetEnumerator();
for (int i = 0; paletteEnum.MoveNext(); i++)
Thanks for the information.
I have a new issue that is similar.
I have created a partial cui with my menus & toolbars.
I then install it into the acad.cui by the following code...
CustomizationSection acadcui = new CustomizationSection(acad_fp);
CustomizationSection swatchdigitalcui = new CustomizationSection(swatchdigital_fp);
if (acadcui.PartialCuiFiles.Contains(swatchdigital_fp) == false)
This does in face add the partial.cui into the main cui but....
It does not activate-it does not add the menu to the main menus.
Where I open the customize dialog, the file is listed but will only show up if I manually press 'Apply'.
I've tryed RefreshWorkspace(), MakeDirty(), etc.
Do you have any idea hope I can get the menu to show up programmatially without having th resort to writing them into the acad.cui directly?
The window you create, that hosts the various tabs is a paletteset (like the MATERIALS palette set). After you create the paletteset, you add controls (palettes) to it (like "Woods and Plastics - Materials Sample" palette in the above paletteset). When you add a control to a palette set, you get back a reference to the new palette as the return value of the Add method.
I see - but I am not creating the palettes programatically.
They are imported from exported palettes.
So my question is how to I get a palette reference from a set of existing palettes.
Basicly I have a palette called "SD Commands" which is one of 45 palettes I have imported.
Is there a way to get it?
I've tryed ToolPalette Manager.Find(Guid) which gives me a 'Catalog Item' which I tryed to cast to Palette. This failed.
Sorry for interrupt, but think you can give the answer of my question which i have posted so many times.
I have made a toolbar by using Autocad Tools->Customization and add made a toolbar in partial cui file. I have also made a Menu bar in that partial Cui file. Now i want to make an option in Menubar by which i can show or hide toolbar programatically. Can you help me how to do so by programatically.
My Problem resolved.
A small Problem more. Could you help me plz.
How to check if current open (active window) drawing in Autocad is Saved (user has already clicked on save and no changes made yet) Or Not Saved?