Mark - Have you ever wondered how AutoCAD remembers
where PalletteSets were docked, the size and position they
had in the last session?
It stores that information in a file, which is located in:
C:\Documents and Settings\<YourLoginName>\Application Data\Autodesk\AutoCAD 200X\RXX.x\enu\Support\Profiles\FixedProfile.aws
Find the file, and make a copy of it, and change the
extension of the copy to .XML and open it in IE or
another XML viewer, and take a look.
You'll see that tools are keyed to the GUIDs you
supply to the PalleteSet's constructor. If you don't
supply a GUID the I'm pretty sure that AutoCAD will
not persist the state of your PaletteSet.
Does the system work behind the scenes to generate the unique identifiers that it needs?
How can it do that, and associate it with a palletset
that only exists in your code? The association is
established by passing the GUID to the PaletteSet's
constructor, which means that the GUID is actually
associated with the code that creates the PaletteSet,
not the PalletSet itself.
So, while anyone can generate a GUID, only your
code can tie it to the PaletteSet that it creates.
Important: Contrary to what I suggested before, using the
GUID of a class is NOT a good idea.
That's because whenever you change your class
(e.g., add/remove a method; change a method's
signature, etc.), the GUID of your class
changes.
So, I have to wear egg here, because that is not
a good idea.
In the latest version of the library I posted, you
can apply a GUID attribute to the PaletteSet class
and the code will look for and use that instead of
the class's GUID.