.NET

Reply
Distinguished Contributor
bthatcher
Posts: 749
Registered: ‎12-12-2003
Message 1 of 4 (343 Views)

Palette - Paletteset - catalog

343 Views, 3 Replies
08-09-2012 07:28 AM

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. 

ADN Support Specialist
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 2 of 4 (308 Views)

Re: Palette - Paletteset - catalog

08-13-2012 03:08 PM in reply to: bthatcher

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





Fenton Webb

Developer Technical Services

Autodesk Developer Network


Distinguished Contributor
bthatcher
Posts: 749
Registered: ‎12-12-2003
Message 3 of 4 (274 Views)

Re: Palette - Paletteset - catalog

08-16-2012 06:34 AM 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.

 

 

 

 

ADN Support Specialist
Balaji_Ram
Posts: 749
Registered: ‎03-21-2011
Message 4 of 4 (228 Views)

Re: Palette - Paletteset - catalog

08-28-2012 11:08 PM 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.