.NET

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

Palette - Paletteset - catalog

333 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 (298 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: 740
Registered: ‎12-12-2003
Message 3 of 4 (264 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: 668
Registered: ‎03-21-2011
Message 4 of 4 (218 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community