vlr-dwg-reacor and running commands

Discussion in 'AutoCAD' started by Trond Engebråten, Jan 25, 2005.

  1. I am trying to run a command from a 3'rd party application when saving the file by using the vlr-dwg-reactor. Then I get an error message "Invalid AutoCAD command". I am getting the same message if I try a regular AutoCAD command. Like in the example below. Is it not possible to run commands when using this reactor?

    (defun MCE3D (reactor dwg)
    ;;; (command "<MYCOMMAND>")
    (command "line")
    (princ)
    )

    (if (not (vlr-reactors :VLR-dwg-Reactor))
    (VLR-dwg-Reactor
    nil
    '(:)VLR-beginSave . MCE3D))
    )
    )
     
    Trond Engebråten, Jan 25, 2005
    #1
  2. Trond Engebråten

    Jeff Mishler Guest

    From the help file:
    A callback function is a regular AutoLISP function, which you define using
    defun. However, there are some restrictions on what you can do in a callback
    function. You cannot call AutoCAD commands using the command function. Also,
    to access drawing objects, you must use ActiveX functions; entget and entmod
    are not allowed inside callback functions. See Reactor Use Guidelines for
    more information
     
    Jeff Mishler, Jan 25, 2005
    #2
  3. Trond Engebråten

    MP Guest

    Look at the docs for reactors.
    If I'm not mistaken, the "Command" function is not allowed in reactor
    callbacks.

    file by using the vlr-dwg-reactor. Then I get an error message "Invalid
    AutoCAD command". I am getting the same message if I try a regular AutoCAD
    command. Like in the example below. Is it not possible to run commands when
    using this reactor?
     
    MP, Jan 25, 2005
    #3
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.