TheSwamp

Code Red => .NET => Topic started by: jgr on September 23, 2010, 08:04:32 PM

Title: .net paletteset versus CAdUiPaletteSet
Post by: jgr on September 23, 2010, 08:04:32 PM
Sorry, my current Questions  += 1

From objectarx:
Windows derived from CAdUiDockControlBar—which includes CAcUiDockControlBar, CAdUiPaletteSet, and CAcTcUiToolPaletteSet—can register themselves using the global function AdUiRegisterTool(). Registered windows that were visible when a session of AutoCAD closed will be automatically started in the next session and will be saved and restored in workspaces.

Command
 REG_SZ
 Command to invoke the window
 ...

I use a guid...commands...REG_SZ....  but does not work. The window does not start automatically at the next session.

Thanks.
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: Jeff H on September 23, 2010, 08:33:18 PM
Not familiar with CAdUiPaletteSet


but this seems to work for me
If your app is demand loaded or when you NetLoad
jgrPS = new Autodesk.AutoCAD.Windows.PaletteSet("jgr Palette", new Guid("24971F58-9504-4495-AF96-44389B271506"));

I sure you know about the Create Guid on tool Menu thought I mentioned it though
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: It's Alive! on September 23, 2010, 08:41:47 PM
There are a few examples of this somewhere in this forum, have a quick search
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: jgr on September 23, 2010, 08:42:41 PM
thanks for replying.
Yes: my app is demand loaded on Start Up and i use:
new Guid(...

Next weekend will send the full code

Thank you very much.
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: It's Alive! on September 23, 2010, 08:47:52 PM
have a look at this thread http://www.theswamp.org/index.php?topic=15939.0
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: jgr on September 23, 2010, 08:50:53 PM
There are a few examples of this somewhere in this forum, have a quick search

Sorry. But before asking: I have searched.
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: jgr on September 23, 2010, 08:54:46 PM
Thanks, and sorry
always answer later. To write I need a translator
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: It's Alive! on September 23, 2010, 08:54:55 PM
did you catch this?

Quote
...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.


maybe have a look at this file and see it looks correct.
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: jgr on September 23, 2010, 09:07:39 PM
Thanks but my problem is not the size and position

According ObjectARX:
Registered windows that were visible when a session of AutoCAD closed will be automatically started in the next session.

And my window does not start in the folowing session.

Language is a big problem for me. Sorry, sorry...
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: LE3 on September 23, 2010, 09:33:26 PM
Language is a big problem for me. Sorry, sorry...

Creo que hablas Español (If not sorry about that, got that impression) - pero tu Ingles esta muy bien, por eso no te preocupes, la mayoria te va a entender, de eso no tengas duda.

Saludos.
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: jgr on September 23, 2010, 09:53:40 PM
(Gracias LE, aunque creo que no es asi ... google trans... etc)
Yes, i (only) speak spanish.

I use CommandFlags.Modal In CommandMethod. It may be that the problem?

Thanks.


Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: It's Alive! on September 23, 2010, 10:03:55 PM
maybe can you use IExtensionApplication to launch your pallet instead of a command? You can also test the visible state as LE mentions
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: LE3 on September 23, 2010, 10:08:35 PM
No he usado las paletas en un buen rato, pero creo que es algo asi (que ya te habian explicado antes):
Code: [Select]
       private static PaletteSet myPaletteSet;

        [CommandMethod("YourPalette")]
        static public void cmd_palette()
        {
            if (myPaletteSet == null)
            {
                myPaletteSet = new PaletteSet("Mi Paleta", new Guid("BF783B3B-8523-4e65-A6D3-72FE202C30FD"));

                // coloca el codigo para la pestaña aqui
            }

            myPaletteSet.Visible = true;
        }

(Gracias LE, aunque creo que no es asi ... google trans... etc)
Yes, i (only) speak spanish.

I use CommandFlags.Modal In CommandMethod. It may be that the problem?

Thanks.



Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: jgr on September 23, 2010, 10:19:21 PM
Thank you all.
Tomorrow proves all your options. I need some sleep.

Thanks.
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: It's Alive! on September 23, 2010, 10:28:31 PM
I need some sleep.

an all night coder   :-D
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: jgr on September 24, 2010, 02:16:29 PM
Solved

It seems that, in this case, the name of palleteset must be the same as the command that displays palette

Code: [Select]
Olde Code
_ps = New Autodesk.AutoCAD.Windows.PaletteSet("Navegador Web", New Guid(PSGGUID))

New Code
_ps = New Autodesk.AutoCAD.Windows.PaletteSet("WEBBWR", New Guid(PSGGUID))


<Autodesk.AutoCAD.Runtime.CommandMethod("HNGRWEBBWR", "WEBBWR", CommandFlags.Transparent)> _
Public Shared Sub ShowWebBrowserPalette()

    _ps.Visible = True

End Sub

Full source:
Title: Re: .net paletteset versus CAdUiPaletteSet
Post by: Glenn R on September 24, 2010, 06:39:00 PM
Hmmm...from memory, as palettes are modeless, if they're executed from a command, that command should have CommandFlags.Session...