I have an operational application that plots drawings and manages a "Version" property that is incremented every time the drawing is saved. This application uses the .beforesave event from the AutoCAD application
This application appears to work well when operating through the Visual Studio editor.
I compiled the code and added information to the registry that automatically loads.
When I compile this appliciation and run it outside of visual studio, the application loads correctly when the commands are entered on the command line. It actually works real slick.
My problem is that somehow I am not able to capture the .beginsave event when I am outside of the development suite.
Here is a "Snippet" of the code that will give you an idea of how I have organized my application. I have also added the registry keys that demand load a part of the application.
One further question : What does the term "Group" mean when used in the registry key?
:::::::::::::::::::::::::::::::::::::::::::::
CODE
::::::::::::::::::::::::::::::::::::::::::::
Namespace PlotFormats
Public Class AcadPlotApp
Implements Autodesk.AutoCAD.Runtime.IExtensionApplication
Public Sub Initialize() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize
Dim oAcadDB As Database
Debug.WriteLine("Transactions after PlotFormats.Initialize : " & CStr(Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.NumberOfActiveTransactions))
oAcadDB = HostApplicationServices.WorkingDatabase()
AddHandler oAcadDB.BeginSave, New DatabaseIOEventHandler(AddressOf IncrementVersionCounter)
oAcadDB = Nothing
End Sub
Private Sub IncrementVersionCounter(ByVal o As Object, ByVal e As Autodesk.AutoCAD.DatabaseServices.DatabaseIOEventArgs)
Public Sub Terminate() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate
End Sub
Public Sub New()
End Sub
End Class
Public Class BallPlotCommands
Public Sub PSB()
Debug.WriteLine("Transactions after PlotFormats.PSB : " & CStr(Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.NumberOfActiveTransactions))
Dim oPSBPlotProcess As New CreatePlot(eDeviceType.PDF)
oPSBPlotProcess = Nothing
End Sub
Public Sub pdf()
Dim oPDFPlotProcess As New CreatePlot(eDeviceType.PDF)
oPDFPlotProcess = Nothing
End Sub
End Class
Windows Registry Editor Version 5.00
:::::::::::::::::::::::::::::::::::::::::::::
Registry Information
::::::::::::::::::::::::::::::::::::::::::::
[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R16.2\ACAD-4003:409\Applications\BallAcadPlot]
"DESCRIPTION"="Ball PDF Plot Creator"
"LOADER"="C:\\Program Files\\Autodesk\\MDT 2006\\user\\vb\\AutoCADPlot\\bin\\BallAcadPlot.dll"
"LOADCTRLS"=dword:0000000e
"MANAGED"=dword:00000001
[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R16.2\ACAD-4003:409\Applications\BallAcadPlot\Commands]
"PDF"="PDF"
[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R16.2\ACAD-4003:409\Applications\BallAcadPlot\Groups]
"BallPlotCommands"="BallPlotCommands"
"AcadPlotApp"="AcadPlotApp"