Command Reactor "Help"

Discussion in 'AutoCAD' started by Rad_Cadder, Nov 22, 2004.

  1. Rad_Cadder

    Rad_Cadder Guest

    I am trying to setup a plot log routine and would like my dialog box to load prior to autocad's plot dialog.
    I believe in order to make this load for every plot I have to set up a reactor to avoid this being bypassed should the user type .plot
    I have never used reactors and could use some help!
    I have the following code saved as a lisp routine, is this correct?
    Is the formatting correct?
    Will this work?
    I have a lisp that loads all routines at startup, should the following code be placed there instead?
    How Do I set this up properly?


    (vl-load-com)
    (defun CommandReactor (objReactor lstCommand);
    (cond
    ((= (car lstCommand) "PLOT")
    (C:plog) ;PLOT LOG ROUTINE
    (princ)
    )
    )
    )
    (setq rxnCommand ( vlr-editor-reactor nil '(:)vlr-commandwillstart . CommandReactor))))
    (cleanreactors)

    (defun cleanreactors ( / TMP)
    (vlr-remove-all :vlr-dwg-reactor)
    )
     
    Rad_Cadder, Nov 22, 2004
    #1
  2. Rad_Cadder

    James Allen Guest

    1. If you are already aware of the built-in plot log and it is insufficient,
    and
    2. if your function involves no user interaction (you mentioned a dialog
    box; no go for reactors),

    then this might help. At a glance it looks like you have the right
    elements, but I see no indication of how you are loading them. For example,
    vlr-editor-reactor should only be called once to set up your reactor. Also
    I'm not sure why the cleanreactors call. If you truly have
    vlr-editor-reactor immediately followed by cleanreactors (and cleanreactors
    is already loaded), then you are disabling the reactor right after you just
    enabled it. If none of that is it, feel free to post back with indication
    of how the different elements are loaded. HTH
    --
    James Allen, EIT
    Malicoat-Winslow Engineers, P.C.
    Columbia, MO


    load prior to autocad's plot dialog.
    reactor to avoid this being bypassed should the user type .plot
     
    James Allen, Nov 22, 2004
    #2
  3. Rad_Cadder

    LUCAS Guest

    (defun C:pLOG ()
    (alert "\nNo plot allow!")
    )
    (vl-load-com)
    (defun COMMANDREACTOR (OBJREACTOR LSTCOMMAND)
    (cond
    ((= (car LSTCOMMAND) "PLOT")
    (C:pLOG)
    (vla-eval (vlax-get-acad-object)
    (strcat "Sendkeys \"{ESC}\"")
    )
    (princ)
    )
    )
    )
    (if (not RXNCOMMAND)
    (setq RXCOMMAND (vlr-editor-reactor
    NIL
    '(:)vlr-commandwillstart . COMMANDREACTOR))
    )
    )
    )

    http://www.mjtd.com/index.html©ú¸g³q¹D

    http://www.mjtd.com/bbs/©ú¸gªÀ°Ï
     
    LUCAS, Nov 23, 2004
    #3
  4. Rad_Cadder

    Rad_Cadder Guest

    I am trying to setup a plot log routine and would like my dialog box to load prior to autocad's plot dialog.

    I believe in order to make this load for every plot I have to set up a reactor to avoid this being bypassed should the user type .plot

    I have never used reactors and could use some help!

    I have the following code saved as a lisp routine, is this correct?

    Is the formatting correct?

    Will this work?

    I have a lisp that loads all routines at startup, should the following code be placed there instead?

    How Do I set this up properly?

    All this being said, I have a lisp routine and dcl file created for logging plots.
    I don't want the user to bypass this by typing .plot so I understand that a reactor will react to the user typing .plot and load my lisp routine and dcl prior to the autocad plot dialog.
    Does anyone know what I am saying?
    I am not sure how to make this any clearer?

    Is this possible, I have read in previous posts that it is but in the replies to my post people state that it is not possible.

    HELP!
     
    Rad_Cadder, Nov 23, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.