.NET

Reply
Active Contributor
jimmydee
Posts: 36
Registered: ‎04-14-2000
Message 1 of 5 (638 Views)

PaletteSet : Title, Command, GUID Confusion

638 Views, 4 Replies
04-05-2010 04:06 PM
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
*Tony Tanzillo
Message 2 of 5 (638 Views)

Re: PaletteSet : Title, Command, GUID Confusion

04-05-2010 08:34 PM in reply to: jimmydee
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:6367354@discussion.autodesk.com...
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
Active Contributor
jimmydee
Posts: 36
Registered: ‎04-14-2000
Message 3 of 5 (638 Views)

Re: PaletteSet : Title, Command, GUID Confusion

04-07-2010 03:11 PM in reply to: jimmydee
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
*Tony Tanzillo
Message 4 of 5 (638 Views)

Re: PaletteSet : Title, Command, GUID Confusion

04-07-2010 08:58 PM in reply to: jimmydee
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:6369122@discussion.autodesk.com...
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
Active Contributor
jimmydee
Posts: 36
Registered: ‎04-14-2000
Message 5 of 5 (638 Views)

Re: PaletteSet : Title, Command, GUID Confusion

04-08-2010 07:03 AM in reply to: jimmydee
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
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.