- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I've creating a custom palette with VB .Net. It is working well. Now I would like to save and load last position (dock or float). I created my palette base on this document http://forums.autodesk.com/autodesk/attachments/autodesk/152/26712/1/CP205-2_Mike_Tuersley.pdf. In this document there is a section «Restoring user settings». So I follow these instructions:
Add: Implements Autodesk.AutoCAD.Runtime.IExtensionApplication at the beginning of the class
Add these functions:
Public Sub Initialize() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize
End Sub
Public Sub Terminate() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate
End Sub
Private Shared Sub ps_Load(ByVal sender As Object, _
ByVal e As Autodesk.AutoCAD.Windows.PalettePersistEventArgs)
Dim a As Double = _
CType(e.ConfigurationSection.ReadProperty("GESBP", 22.3), Double)
End Sub
Private Shared Sub ps_Save(ByVal sender As Object, _
ByVal e As Autodesk.AutoCAD.Windows.PalettePersistEventArgs)
e.ConfigurationSection.WriteProperty("GESBP", 22.3)
End Sub
GESBP is the name of the function and the commandmethod calling the palette. For the ps_load and ps_save I don't understand what I'm doing. What is double value use for? For the ps_Save there is also a 32.3 in the original document so I try both value but I think is a mispelled value.
Next I created my palette set using a GUID like this:
m_bps = New Autodesk.AutoCAD.Windows.PaletteSet("Palette des blocs", New Guid("{dcc7028a-d010-48e8-ae1c-8df9d0f7b111}"))
I start AutoCAD in debug mode. The first time I start AutoCAD (2012), there is no problem. The next time, AutoCAD hang at startup. I had to reset the current profile to succed to start AutoCAD again.
What I'm doing wrong???
Regards,
André
Solved! Go to Solution.