I am working on Windows 7 64bit, Visual Basic 2010 Express with AutoCAD 2011 64bit.
I am trying to work through a training manual and have stumbled at the first hurdle.
When i run the application it starts AutoCAD, then i go to NETLOAD and run the dll at which point i can run the command 'newcmd1' and the box appears.
I switch back to VB to edit the text (even with breakpoint) and i can't edit it. I can't pause it to edit, i have to stop the code running which closes autocad, change the code, then repeat the whole process.
With one simple box it is annoying, when an application gets bigger it will just get impossible.
Is this how it is supposed to work? or is there a way to make it work properly?
This is the code:
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.ApplicationServices.Application
Imports Autodesk.AutoCAD.LayerManager
Imports Autodesk.AutoCAD.Windows
Public Class vbcadTemplateClass
' Define command 'NewCmd1'
<CommandMethod("NewCmd1")>
_Public Sub NewCmd1()
MsgBox( "NewCmd1")
' Type your code here
End Sub
End Class
I believe if i run the code it should Open CAD and then Open the dialogue box allowing me to debug, but i have to manually load that particular dll with NETLOAD. If i try to pause the code it comes up with a message saying
'Unable to break execution. The process is not currently executing the type of code that you selected to Debug'
Three things:
You can't edit code while your application is running when using a 64bit OS and Visual Studio (this is only available when using 32bit).
See Kean Walmsley's blog on how to debug a netloaded dll using Express Versions of Visual Studio:
http://through-the-interface.typepad.com/through_the_interface/2006/07/debugging_using.html
When you start you Autocad using the debug go command, if you want your dll to automatically netload you need to either start it using a script (scr) file as a startup parameter or use one of the other methods to load your dll automatically (Visual Studio will not do this for you).