.NET

Reply
Valued Contributor
86 Posts
1 Kudo
Registered: ‎07-14-2010
Post 1 of 6

How to close a PaletteSet from code

276 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
762 Posts
100 Kudos
Registered: ‎03-21-2011
Post 2 of 6

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
1 Posts
0 Kudos
Registered: ‎11-29-2012
Post 3 of 6

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
762 Posts
100 Kudos
Registered: ‎03-21-2011
Post 4 of 6

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
225 Posts
24 Kudos
Registered: ‎09-15-2011
Post 5 of 6

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
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 6 of 6

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
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!