.NET

.NET

Reply
Active Member
Davidgun64
Posts: 9
Registered: ‎11-09-2011
Message 1 of 3 (173 Views)
Accepted Solution

Help with persistent palette set.

173 Views, 2 Replies
02-12-2013 05:52 PM

Hello

 

I am trying to create a custom palette that will load whenever Autocad loads.  The code below works with one exception.

 

 <CommandMethod("gtPalette")> _
        Public Sub DoIt()
            If m_ps = Nothing Then
                Dim MYGuid As Guid = New Guid("{4AECF36F-C7E9-4C59-B72B-36A98DDA1D24}")
                m_ps = New Autodesk.AutoCAD.Windows.PaletteSet("gtPalette", MYGuid)
                myCoordPalette = New UserControl1()
                m_ps.Add("Coordinate List", myCoordPalette)
            End If
            m_ps.Visible = True
        End Sub

 The problem is that my Palette title is now "gtPalette"  which I do not want.  However if I change 

 

PaletteSet("gtPalette", MYGuid)

to 

PaletteSet("GunTech Cogo", MYGuid)

Then what occurs is that when Acad (actually I'm using Civil 3D 2012) start it trys to execute a command called 'GunTech' and then one called "cogo'.  Cogo being a valid Civil 3d Command brings up the Cogo dialog.  If I then type the command gtPalette it appears in the correct location.

 

Currently on my development PC the first code works perfect and brings up a palette that even has the correct title of "GunTech Cogo".  this info has presumable been saved with the GUID in my previous attempts to get the code to work.  (this is the first time I've ever used a GUID so I'm a bit out of my depth here)

 

Any help is much appreciated.

 

David

Hi,

 

try (with a new Guid)

 

 <CommandMethod("gtPalette")> _
Public Sub DoIt()
If m_ps = Nothing Then
Dim MYGuid As Guid = New Guid("{4AECF36F-C7E9-4C59-B72B-36A98DDA1D24}")
m_ps = New Autodesk.AutoCAD.Windows.PaletteSet("gtPalette", MYGuid)
m_ps.Name = "GunTech Cogo"
myCoordPalette = New UserControl1()
m_ps.Add("Coordinate List", myCoordPalette)
End If
m_ps.Visible = True
End sub

 

 

*Expert Elite*
_gile
Posts: 2,133
Registered: ‎04-29-2006
Message 2 of 3 (163 Views)

Re : Help with persistent palette set.

02-12-2013 10:08 PM in reply to: Davidgun64

Hi,

 

try (with a new Guid)

 

    <CommandMethod("gtPalette")> _
        Public Sub DoIt()
            If m_ps = Nothing Then
                Dim MYGuid As Guid = New Guid("{4AECF36F-C7E9-4C59-B72B-36A98DDA1D24}")
                m_ps = New Autodesk.AutoCAD.Windows.PaletteSet("gtPalette", MYGuid)
                m_ps.Name = "GunTech Cogo"
                myCoordPalette = New UserControl1()
                m_ps.Add("Coordinate List", myCoordPalette)
            End If
            m_ps.Visible = True
End sub

 

 

Gilles Chanteau
Active Member
Davidgun64
Posts: 9
Registered: ‎11-09-2011
Message 3 of 3 (153 Views)

Re : Help with persistent palette set.

02-13-2013 03:22 AM in reply to: _gile

That worked.  Thanks a lot.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.