本帖最后由 highflybird 于 2011-6-18 01:55 编辑
http://forums.autodesk.com/t5/Autodesk-ObjectARX/Calling-Lisp-from-ObjectArx/td-p/321529
See example:
=========LISP code start==============
- (defun LispFunction ( prl )
- (princ prl)
- )
- ;
- ; If you want to be able to invoke this function from an external ObjectARX
- ; application, you can use vl-acad-defun to make the function accessible.
- ;
- (vl-acad-defun 'LispFunction)
=========LISP code end===============
- =========C++ code start==============
- int ads_call_lisp_function(void)
- {
- char *output_line = "\nHello, Lisp!!!";
- resbuf *rb_in = acutBuildList(RTSTR,"LispFunction",
- RTSTR,output_line,RTNONE);
- resbuf *rb_out = NULL;
- int rc = acedInvoke(rb_in,&rb_out);
- acutRelRb(rb_in); acutRelRb(rb_out);
- return (RSRSLT) ;
- }
|