.NET command called by LISP

.NET command called by LISP

klonbeck
Advocate Advocate
524 Views
2 Replies
Message 1 of 3

.NET command called by LISP

klonbeck
Advocate
Advocate

 

I have a .NET app that calls wd_proj_wdp_data LISP API through a result buffer. If the app is called on the command line using the .NET defined command name everything works fine. I would like to the option to start my app by using the LISP command call, (command "commandname").

 

When I use the LISP command call the result buffer returns null. I don't know why it is returning null.

 

Why would the LISP command call prevent the result buffer from returning a value?

 

I am running AutoCAD Electrical 2016 on Windows 7

 

0 Likes
525 Views
2 Replies
Replies (2)
Message 2 of 3

Virupaksha_aithal
Autodesk Support
Autodesk Support

Hi,

 

are you using "LispFunction" ? if not, please try using LispFunction,

 

[LispFunction("MyLispFunction", "MyLispFunctionLocal")]
public int MyLispFunction(ResultBuffer args) // This method can have any name
{
          
    return 1;
}


Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 3

felix.corre
Advocate
Advocate

Hi,

I have the same problem whith the following VB.NET app. When i call the command "felixMV3" on the command line everything works fine but when i want start my app by using the LISP command call (command "felixMV3") AUTOCAD crash.

 <Autodesk.AutoCAD.Runtime.CommandMethod("felixMV3", "felixMV3", Autodesk.AutoCAD.Runtime.CommandFlags.Modal)>
    Public Sub felixMV3()

        Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
        Dim acDoc As Document = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument
        Dim ReturnBlkvalue As String = Lispfunction("C:ReturnBlk")
    End Sub
#End Region


    Public Function Lispfunction(varlisp As String) As String
        Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
        Dim arg As New TypedValue(CInt(LispDataType.Text), varlisp)
        Dim arginv As New ResultBuffer(arg)
        Dim resbuf As ResultBuffer = Application.Invoke(arginv)
        Dim values = resbuf.AsArray()
        Dim value As String = values(0).Value
        Dim blkname As String = value
        Return value
    End Function

Anyone can help me please?

Félix.

0 Likes