PaletteSet - Detect when user changes palettes

PaletteSet - Detect when user changes palettes

RodWing
Enthusiast Enthusiast
1,097 Views
3 Replies
Message 1 of 4

PaletteSet - Detect when user changes palettes

RodWing
Enthusiast
Enthusiast

I've got a PaletteSet with three User Control Palettes.

 

I can iterate through the ps.Item collection to get to individual palettes, but how can I detect when a user select a particular palette?

 

Thanks.

 

0 Likes
Accepted solutions (1)
1,098 Views
3 Replies
Replies (3)
Message 2 of 4

Virupaksha_aithal
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

i feel PaletteSet.PaletteActivated event should provide you the required hint



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 4

ActivistInvestor
Mentor
Mentor

@Anonymous wrote:

I've got a PaletteSet with three User Control Palettes.

 

I can iterate through the ps.Item collection to get to individual palettes, but how can I detect when a user select a particular palette?

 

Thanks.

 


The PaletteActivated event is not terribly useful (actually it is the Palette class that is not terribly useful) unto itself, because there is no mapping between Palettes and the control they host. You should create a Dictionary<string, Control> that maps the name of the palette to the Control it hosts, and use that to lookup the control, given the Palette's Name property (and that presumes that your palettes have distinct names).

0 Likes
Message 4 of 4

RodWing
Enthusiast
Enthusiast

The PaletteSet.PaletteActivated event did exactly what I needed. 

 

Thank you.

0 Likes