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

How to close a PaletteSet from code

5 REPLIES 5
Reply
Message 1 of 6
yaqiz
1205 Views, 5 Replies

How to close a PaletteSet from code

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

5 REPLIES 5
Message 2 of 6
Balaji_Ram
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

Message 3 of 6
celwk
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!

 

Tags (1)
Message 4 of 6
Balaji_Ram
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

Message 5 of 6
khoa.ho
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

 

Message 6 of 6
DiningPhilosopher
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).

 

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