Message 1 of 10
changing drawing
Not applicable
02-24-2008
11:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I use the handler DocumentBecameCurrent to detect a switching of drawings. When I try to use the database to check for non existing layers I got an fatal error.
I use the following code:
On load of the dll the handler is loaded:
Public Sub Initialize() Implements IExtensionApplication.Initialize
'----------------------------------------
AddHandler Application, AddressOf SwitchStart
End Sub
At drawing switch the following handler is executed. The error occurs in Layers = New LayerManager
Here the layers are checked and if the do not exist created.
Public Sub SwitchStart(ByVal Sender As Object, ByVal e As Autodesk.AutoCAD.ApplicationServices.DocumentCollectionEventArgs)
' Make reference to drawing / Database
ed = e.Document.Editor 'Application.DocumentManager.MdiActiveDocument.Editor
db = e.Document.Database 'HostApplicationServices.WorkingDatabase
' Make a new Layermanager
Layers = New LayerManager
Layers.DetectTrackLayers()
End Sub
Has any one a clue off the error?
Greetings,
Gerard van der Sel.
I use the following code:
On load of the dll the handler is loaded:
Public Sub Initialize() Implements IExtensionApplication.Initialize
'----------------------------------------
AddHandler Application, AddressOf SwitchStart
End Sub
At drawing switch the following handler is executed. The error occurs in Layers = New LayerManager
Here the layers are checked and if the do not exist created.
Public Sub SwitchStart(ByVal Sender As Object, ByVal e As Autodesk.AutoCAD.ApplicationServices.DocumentCollectionEventArgs)
' Make reference to drawing / Database
ed = e.Document.Editor 'Application.DocumentManager.MdiActiveDocument.Editor
db = e.Document.Database 'HostApplicationServices.WorkingDatabase
' Make a new Layermanager
Layers = New LayerManager
Layers.DetectTrackLayers()
End Sub
Has any one a clue off the error?
Greetings,
Gerard van der Sel.