Invoke error calling Autolisp program = eInvalidInput

Invoke error calling Autolisp program = eInvalidInput

Anonymous
Not applicable
883 Views
1 Reply
Message 1 of 2

Invoke error calling Autolisp program = eInvalidInput

Anonymous
Not applicable

I'm hoping to get some assistance with resolving an error in calling an Autolisp program with the Invoke method. The following code returns an eInvalidInput error.

 

    Public Sub CallLisp(strFName As String)
        Try
            Dim resbuf As New AccDb.ResultBuffer((New AccDb.TypedValue(CInt(LispDataType.Text), strFName)))
            Autodesk.AutoCAD.ApplicationServices.Core.Application.Invoke(resbuf)
        Catch ex As Exception
            MsgBox("CallLisp: " & ex.Message)
            Debug.Print(ex.Message)
        End Try
    End Sub

 The Autolisp program is loaded in the drawing and I can call it from the command line without issue. I've made sure to use vl-acad-defun to register the Autolisp command but can't seem to get around this error. I'm relatively new to trying to use the ResultBuffer so don't know if that is where my error is.

 

Trying to upgrade from AutoCAD 2011 to 2014 and need the Autolisp to be synchronous with the .Net code. Have looked at a number of forum posts including:

http://forums.autodesk.com/t5/net/resultbuffer-and-application-invoke/m-p/5212711/highlight/true#M41...

Any help will be appreciated.

 

Bernie

0 Likes
Accepted solutions (1)
884 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution
Found my own error. Code is good but I was neglecting to include the "c:" as part of the defined Autolisp file name when calling the sub.
0 Likes