Maintain Palette State

Maintain Palette State

SRSDS
Advisor Advisor
545 Views
1 Reply
Message 1 of 2

Maintain Palette State

SRSDS
Advisor
Advisor

 

At the moment I am loading my palette in the AutoCAD Initialize routine but I don't necessarily want it loaded if the Palette was closed in a previous instance of AutoCAD. So I'm guessing I must remove it from the AutoCAD startup:

 

    Public Sub Initialize() Implements IExtensionApplication.Initialize
        Dim pal = New PaletteClass()
        pal.LoadPalette()
    End Sub

From what I understand it gets assigned a GUID which tells AutoCAD if it should be reloaded or not on the next instance. How can I tell if it has or hasn't been loaded so that I can bypass any code interaction with a palette that may not be there?

0 Likes
Accepted solutions (1)
546 Views
1 Reply
Reply (1)
Message 2 of 2

SRSDS
Advisor
Advisor
Accepted solution

I worked it out. Sorry, probably obvious.

 

The pallete should be loaded but it was being forced visible (ps.visible=true) in the LoadPalette routine  regardless of what the GUID state. If that makes any sense.

And, if for some reason, I wanted to disable any interaction I could check it's visibility state.

0 Likes