I am having a very interesting problem with my code. When I run my code the first time CommandMethod works and executes without any problems, When I try to run it again I get : Unknown command. I have to reopen AutoCAD in order to run the command again.
Hi everyone, I was able to narrow the problem to ‘System.IO.StreamReader’
At the start of my code I read a large data file (9000 lines) in with this code:
Public Class Test
<CommandMethod("ttt", CommandFlags.Modal)> _
Public Sub Test()
Dim objReader As New System.IO.StreamReader("C:\Test.txt")
sLine = objReader.ReadLine()
If Not sLine Is Nothing Then
Loop Until sLine Is Nothing
After reading in the file in, when I try to read the file again I get an ‘Unknown command’. I wonder if the problem is with the buffer . . . . . .