PaletteSet : Title, Command, GUID Confusion

PaletteSet : Title, Command, GUID Confusion

jimmydee
Enthusiast Enthusiast
2,610 Views
5 Replies
Message 1 of 6

PaletteSet : Title, Command, GUID Confusion

jimmydee
Enthusiast
Enthusiast
I’m trying to following an example that I found for creating a PalettSet with a UserControl and I think I finally have everything working except one thing. I’m using AutoCAD 2008 (AutoCAD Architecture 2008 SP1).

The following line creates a PaletteSet titled "Layer List" just as I expect it to…
myPaletteSet = New Autodesk.AutoCAD.Windows.PaletteSet("Layer List")

…However when I use a GUID, the title "Layer List" magically becomes a command which of course starts the LAYER Command followed by the LIST Command.
myPaletteSet = New Autodesk.AutoCAD.Windows.PaletteSet("Layer List", New Guid("d7b78d6c-14b2-45b1-bc0b-95f365f60ec9"))

What the heck is going on here? Is this another AutoCAD bug that takes something really cool and makes it completely useless, or am I just too dense and missing something obvious?

By the way, I’m using this AU tutorial.
http://au.autodesk.com/?nd=class&session_id=910

Thanks,
Jim
0 Likes
2,611 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
It's not a bug, it's just a facet of some of the worst
documentation in the software industry.

When you use the overload that takes a Guid, the
"name" argument isn't the name of the PaletteSet,
it's the command that AutoCAD issues to show the
PaletteSet when AutoCAD starts, if the PaletteSet
was visible when AutoCAD was last closed. If you
don't use the overload that takes a Guid, then your
PaletteSet's state isn't persisted and AutoCAD will
not show it automatically at startup.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:[email protected]...
I'm trying to following an example that I found for creating a PalettSet with a
UserControl and I think I finally have everything working except one thing. I'm
using AutoCAD 2008 (AutoCAD Architecture 2008 SP1).

The following line creates a PaletteSet titled "Layer List" just as I expect it
to.
myPaletteSet = New Autodesk.AutoCAD.Windows.PaletteSet("Layer List")

.However when I use a GUID, the title "Layer List" magically becomes a command
which of course starts the LAYER Command followed by the LIST Command.
myPaletteSet = New Autodesk.AutoCAD.Windows.PaletteSet("Layer List",
New Guid("d7b78d6c-14b2-45b1-bc0b-95f365f60ec9"))

What the heck is going on here? Is this another AutoCAD bug that takes something
really cool and makes it completely useless, or am I just too dense and missing
something obvious?

By the way, I'm using this AU tutorial.
http://au.autodesk.com/?nd=class&session_id=910

Thanks,
Jim
Message 3 of 6

jimmydee
Enthusiast
Enthusiast
Tony,

Thank you for your response. I did a little more testing and you are correct. When using the GUID overload my palette is loaded the next time I launch AutoCAD if I supply he correct command in the NAME argument. However this NAME argument, when supplied the command, is also used to name the palette. So it seem to be using the supplied command for both the command and palette title which is not very useful. I keep thinking I must be missing something very simple, because I can’t believe the intent is for it to work this way.

How can I use the command name and GUID overload for a persistent palette and set the title of the palette too?

Thanks for your help.
Jim
0 Likes
Message 4 of 6

Anonymous
Not applicable
Look at the properties of the PaletteSet class.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:[email protected]...
Tony,

Thank you for your response. I did a little more testing and you are correct.
When using the GUID overload my palette is loaded the next time I launch AutoCAD
if I supply he correct command in the NAME argument. However this NAME argument,
when supplied the command, is also used to name the palette. So it seem to be
using the supplied command for both the command and palette title which is not
very useful. I keep thinking I must be missing something very simple, because I
can't believe the intent is for it to work this way.

How can I use the command name and GUID overload for a persistent palette and
set the title of the palette too?

Thanks for your help.
Jim
0 Likes
Message 5 of 6

jimmydee
Enthusiast
Enthusiast
Wow, that was so obvious, but in my defense I was led down the same path by two different tutorials and both of them used the first argument when creating the PaletteSet to name the PaletteSet. Confused no more.

Thank you much,
Jim
0 Likes
Message 6 of 6

Anonymous
Not applicable
Wow Thanks for the info ... It took me hours and hours to even track the bug down to the paletteset because it was just some gibbererish in the commandline on start up that wreaked havoc... Autodesk and especially managed Autocad has one of the worst documentations in existence. They are doing a great job with their blogs but a good documentation would be more efficient in most of the cases...
0 Likes