Author Topic: Paletteset startup location  (Read 11321 times)

0 Members and 1 Guest are viewing this topic.

TonyT

  • Guest
Re: Paletteset startup location
« Reply #15 on: April 14, 2007, 12:54:13 AM »
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.

Quote

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:-o

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.


« Last Edit: April 14, 2007, 12:55:46 AM by TonyT »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Paletteset startup location
« Reply #16 on: April 14, 2007, 12:56:48 AM »
This is what's called the "Bleeding Edge", yes ?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

mohnston

  • Bull Frog
  • Posts: 305
  • CAD Programmer
Re: Paletteset startup location
« Reply #17 on: April 16, 2007, 02:09:54 PM »
Tony,
Thanks a TON for the explanation. I can tell you I learned a lot from your comments. How much of it will stay in my leaky head is another story.
This part in particular caught my attention because I think it connects with something I already knew:
. . .
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:-o
. . .
Also known as "breaking compatability"?

It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions