Slow and jerky VB performance on AutoCAD 2015
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a some old vb projects which work fine in all versions except 2015.
In a very simple vb routine below, I tried to get all the layers by the following code in a form with a listbox box when it loads :
Public Class Form1
Dim oAcad As AutoCAD.AcadApplication
Dim oAcadDoc As AutoCAD.AcadDocument
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
oAcad = GetObject(, "Autocad.Application.20")
If oAcad.Documents.Count > 0 Then
oAcadDoc = oAcad.ActiveDocument
Try
For Each oLayer As AutoCAD.AcadLayer In oAcadDoc.Layers
Me.lstLayer.Items.Add(oLayer.Name)
Next
Catch ex1 As System.Exception
Debug.WriteLine("1:" + ex1.Message)
End Try
Else
MsgBox("No Document Opened.")
End If
Catch ex2 As Exception
MsgBox("2:" + ex2.Message)
End Try
End Sub
End Class
'
'
'
Strangely, it does not return the complete list of layers but only some of the layers ( the number of layers varies every time I run it).
I tried to troubleshoot and it is returning the following error message:
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in GetAllLayers2015.exe
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in CustomMarshalers.dll
first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED)
On one computer it seems to work fine without any problem.
But it is definitely slow on all other computers I've tested on.
Any idea what could be causing this problem ?
I am using VS2012.
TIA.
Andrew,