Author Topic: trigger a lisp command after "plotting"  (Read 2307 times)

0 Members and 1 Guest are viewing this topic.

dubb

  • Swamp Rat
  • Posts: 1105
trigger a lisp command after "plotting"
« on: May 31, 2005, 06:34:31 PM »
is there a way to trigger another lisp command after running the plot command?

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
trigger a lisp command after "plotting"
« Reply #1 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.

dubb

  • Swamp Rat
  • Posts: 1105
trigger a lisp command after "plotting"
« Reply #2 on: May 31, 2005, 08:01:57 PM »
HUH..?..IM UNFAMILIAR ON HOW TO USE THESE REACTORS...

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
trigger a lisp command after "plotting"
« Reply #3 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!
  )

dubb

  • Swamp Rat
  • Posts: 1105
trigger a lisp command after "plotting"
« Reply #4 on: June 01, 2005, 01:50:47 PM »
oOO..MAN..that worked perfect..thanks Jeff

daron

  • Guest
trigger a lisp command after "plotting"
« Reply #5 on: June 01, 2005, 02:36:56 PM »
Just make sure you obey the NO COMMAND in the lisp you put that in.

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
trigger a lisp command after "plotting"
« Reply #6 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.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org