.NET

.NET

Reply
Valued Contributor
yaqiz
Posts: 86
Registered: ‎07-14-2010
Message 1 of 2 (192 Views)
Accepted Solution

How to set one palette on a paletteset on top through code?

192 Views, 1 Replies
04-11-2012 08:37 AM

Hi All,

 

I have a paletteset which contains multiple palettes. How can I set one of the palette on top through code?

 

It is something like set current tab in tab control

 

Any hints?

 

Thanks

 

Regards,

Yaqi

Palette contained in a PaletteSet is indexed by its order being added into the paletteSet. If you know the index of the pallete, you can call PaletteSet.Activate(index) to activate the palette, or you can loop the PaletteSet with palette name (Palette has a name when being added into PaletteSet):

 

For i As Integer=0 To myPaletteSet.Count-1

    Dim p As Palette=myPaletteSet(i)

    If  p.Name.ToUpper()="SOMENAME" THEN

        myPalleteSet.Activate(i)

        Exit For

    End If

Next

*Expert Elite*
norman.yuan
Posts: 1,063
Registered: ‎04-27-2009
Message 2 of 2 (183 Views)

Re: How to set one palette on a paletteset on top through code?

04-11-2012 10:03 AM in reply to: yaqiz

Palette contained in a PaletteSet is indexed by its order being added into the paletteSet. If you know the index of the pallete, you can call PaletteSet.Activate(index) to activate the palette, or you can loop the PaletteSet with palette name (Palette has a name when being added into PaletteSet):

 

For i As Integer=0 To myPaletteSet.Count-1

    Dim p As Palette=myPaletteSet(i)

    If  p.Name.ToUpper()="SOMENAME" THEN

        myPalleteSet.Activate(i)

        Exit For

    End If

Next

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.