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

Palette - Paletteset - catalog

3 REPLIES 3
Reply
Message 1 of 4
bthatcher
583 Views, 3 Replies

Palette - Paletteset - catalog

I'm trying to add catalogs to a paletteset. I can create a new palette with a user control, but I cant figure out how to add a catalog to it. toolpalettemanager is great, but only seem to work with the OOTB tool palette. How do I do this and can someone post an example. Thanks. 

3 REPLIES 3
Message 2 of 4
fenton.webb
in reply to: bthatcher

Can you post a picture of what you are trying to acheive please?




Fenton Webb
AutoCAD Engineering
Autodesk

Message 3 of 4
bthatcher
in reply to: fenton.webb

Yes. I can add catalogs to the default toolpalette (first image) with the following code...

 

            ToolPaletteManager tpm = ToolPaletteManager.Manager;
            tpm.CatalogPath = "C:\\catalogpath";
            tpm.LoadCatalogs();

 but I cannot seem to control the location, it keeps resetting and moving around.

 

or I can easily create a new palette (second image), but it's unclear how to add catalogs to it...

 

        public PaletteSet myPaletteSet;
        public ToolPalette_02.UserControl1 myPalette1;

        [CommandMethod("testpalette")]
        public void Method()
        {
            myPalette1 = new ToolPalette_02.UserControl1();

            myPaletteSet = new PaletteSet("My Palette");    
            myPaletteSet.Add("Test Palette", myPalette1);
            myPaletteSet.Visible = true;
        }

 Also if I remember correctly, palette was defined in more than one namespace. That was causing a lot of problems until I abandon one of them. Can you provide examples of controlling the default toolpalette location or adding catalogs to a custom tool palette? Thank you.

 

 

 

 

Message 4 of 4
Balaji_Ram
in reply to: bthatcher

Hi,

 

The tool palette and the paletteset are different.

The paletteset cannot deal with catalogs while the Tool palette can.

 

Can you please explain what you mean by "cannot seem to control the location, it keeps resetting and moving around."

 

I tried the sample code that you had but the tool palette positions seemed to be retained even after I restarted AutoCAD. I have attached a recording of the steps that i am trying. Can you please see if I am doing something differently ?

 

Also, can you try saving the catalogs after you have changed the locations ?

 

[CommandMethod("SaveCatalogs")]
		public void DoIt1()
		{
			ToolPaletteManager mgr = ToolPaletteManager.Manager;
			mgr.SaveCatalogs();
		}

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

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