.NET

Reply
Valued Contributor
yaqiz
Posts: 86
Registered: ‎07-14-2010
Message 1 of 6 (258 Views)

How to close a PaletteSet from code

258 Views, 5 Replies
07-23-2012 09:35 AM

Hi Guys,

 

Because there is no way to tell the difference between miniminise ("-") to close ("x") on paletteset. I put a button on my user control to write my own code to close the PaletteSet.

 

m_ps is the current PaletteSet, m_uc is my user control which has been loaded into m_ps.

 

what code I need to write inside my close button click event to unload m_uc , close m_ps and set both m_uc and m_ps to nothing?

 

 Thanks very much

ADN Support Specialist
Balaji_Ram
Posts: 715
Registered: ‎03-21-2011
Message 2 of 6 (237 Views)

Re: How to close a PaletteSet from code

07-26-2012 07:08 AM in reply to: yaqiz

Hi Yaqi,

 

Simply set the Visible property of the palette to true/false from the button handler.



Balaji
Developer Technical Services
Autodesk Developer Network

New Member
celwk
Posts: 1
Registered: ‎11-29-2012
Message 3 of 6 (205 Views)

Re: How to close a PaletteSet from code

11-29-2012 12:54 AM in reply to: yaqiz

Help!

How can I get a PaletteSet which is not created by myself?

e.g. now I know the way to get the ribbon paletteset by Autodesk.AutoCAD.Ribbon.RibbonServices.RibbonPaletteSet.

 

But how can I get other paletteset like this palette(or this is not a palette but a panel??):

 PaletteSet.png("Task pane" in English?)

Is there a property to get  all the palette collection??

 

Thanks for any help!

 

ADN Support Specialist
Balaji_Ram
Posts: 715
Registered: ‎03-21-2011
Message 4 of 6 (176 Views)

Re: How to close a PaletteSet from code

12-06-2012 08:44 AM in reply to: celwk

Sorry, I dont find any way to get access to the PaletteSet that hasnt been created by you.

 

I am just curious to know, why you would need that if it wasnt created by your plugin ?

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Mentor
khoa.ho
Posts: 219
Registered: ‎09-15-2011
Message 5 of 6 (164 Views)

Re: How to close a PaletteSet from code

12-06-2012 12:03 PM in reply to: celwk

There is nowhere to get a PaletteSet which is not created by yourself, because AutoCAD does not save it to the application settings.

 

What we see on AutoCAD is ToolPalette, which is different which PaletteSet. ToolPalette is stored as an external .ATC file that is controlled (read & save) by ToolPaletteManager.Manager which can load external catalogs (content location URLs) to display on this ToolPalette. I don't see .NET API to load an existing ToolPalette from an external ATC file. From there you can handle it.

 

PaletteSet is the code container that we can place our user controls (PaletteSet.Add method), and we have a right to handle it. But it is initialized by code and not saved to an external file like .ATC of ToolPalette.

 

-Khoa

 

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 6 of 6 (147 Views)

Re: How to close a PaletteSet from code

12-07-2012 04:38 AM in reply to: celwk

You don't have access to PaletteSets that AutoCAD creates and uses (except for the Ribbon), but most of them have commands to close them (for example, "PROPERTIESCLOSE" will close the PropertiesPalette).

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.