|
You can directly call lisp function from ObjectARX application using
acedInvoke(...).
See example:
=========LISP code start==============
(defun myfun()
(setq myfunret 2)
)
;
; 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 'myfun)
=========LISP code end===============
=========C++ code start==============
int call_lisp_function(void)
{
resbuf *rb_in = acutBuildList(RTSTR,"myfun",RTNONE);
resbuf *rb_out = NULL;
int rc = acedInvoke(rb_in,&rb_out);
acutRelRb(rb_in); acutRelRb(rb_out);
acedGetSym("myfunret",&rb_out);
return (RSRSLT) ;
}
=========C++ code end===============
|
|