TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: xinxirong on April 06, 2017, 07:25:43 PM

Title: Use arx to trans arbitary arguments to lisp function?
Post by: xinxirong on April 06, 2017, 07:25:43 PM
for example
(defun myadd ( lst / )
  (mapcar '+ lst)
)
in arx,defun a ads function tran_args_fun.
then i can use (tran_args_fun 'myadd 1 2 3 4 5 6....) to subsitude the lisp fun +.
Title: Re: Use arx to trans arbitary arguments to lisp function?
Post by: xinxirong on April 06, 2017, 08:29:27 PM
you call acedInvoke
Other way is calling undocumented function acedEvaluateLisp():
int __cdecl acedEvaluateLisp(wchar_t const *str, struct resbuf *&result);
where str is a lisp-expression, and result is a result of evaluation of this lisp-expression