I'm starting the transition from VBA to VB .Net, so this is probably incredibly easy. I haven't even started writing my own code yet, just pasting snippets to get a feel for everything. I've put in a sub routine to draw a single line in model space of AutoCAD. Works great. The problem occurs when I create a form and try to call the sub routine from a button. Then I get an "eLockViolation" when I try to open the model space "for write". I'm guessing that it is because AutoCAD is no longer active because this form is active? If that makes any sense? But, even if I hide the form before I call the sub routine, I still get the error.
Any suggestions would be appreciated.
Thanks
Dave
See attachment for the code.