TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: dubb on May 31, 2005, 06:34:31 PM

Title: trigger a lisp command after "plotting"
Post by: dubb on May 31, 2005, 06:34:31 PM
is there a way to trigger another lisp command after running the plot command?
Title: trigger a lisp command after "plotting"
Post by: Jeff_M on May 31, 2005, 07:23:19 PM
Sure, use the :vlr-commandended event of the Editor reactor and watch for the "Plot" command command.
Title: trigger a lisp command after "plotting"
Post by: dubb on May 31, 2005, 08:01:57 PM
HUH..?..IM UNFAMILIAR ON HOW TO USE THESE REACTORS...
Title: trigger a lisp command after "plotting"
Post by: Jeff_M on May 31, 2005, 09:14:35 PM
OK, I couldn't recall if you had worked with reactors before. Here's an example for you:
Code: [Select]

(or jmm:plot_reactor
    (setq jmm:plot_reactor (vlr-editor-reactor nil '((:vlr-commandEnded . jmm:cmdEnd)))))

(defun jmm:cmdEnd (calling cmd)
  (princ ".....made it here....");remove this, just for testing....
  (cond ((eq "PLOT" (strcase (car cmd))) (jmm:testlisp))
;you could add other commands to track and do other things here
)
  (princ)
  )

(defun jmm:testlisp ()
  (princ "Command was PLOT")
  ;modify the line above to call the desired lisp
  ;NOTE! The lisp you call must NOT use the Command function!
  )
Title: trigger a lisp command after "plotting"
Post by: dubb on June 01, 2005, 01:50:47 PM
oOO..MAN..that worked perfect..thanks Jeff
Title: trigger a lisp command after "plotting"
Post by: daron on June 01, 2005, 02:36:56 PM
Just make sure you obey the NO COMMAND in the lisp you put that in.
Title: trigger a lisp command after "plotting"
Post by: JohnK on June 01, 2005, 03:03:39 PM
" (or jmm:plot_reactor
    (setq jmm:plot_reactor (vlr-editor-reactor nil '((:vlr-commandEnded . jmm:cmdEnd))))) "

...Nice trick Jeff.


Edit: Darn button!?

Thats "clean" I like that.