Disable a command

Discussion in 'AutoCAD' started by Dale Levesque, Nov 30, 2004.

  1. Is it possible to disable the eattedit command in AutoCAD? I don't even want
    it to be available when the underscore and period are entered before the
    actual command name. I tried loading the following lisp routine:

    (defun c:eattedit()
    (princ)
    )

    just to test but that didn't work. Any suggestions?
     
    Dale Levesque, Nov 30, 2004
    #1
  2. Dale Levesque

    Tom Smith Guest

    Use the undefine command, but I don't think you can defeat the "period"
    version.

    Why so intent on killing the command? Make a macro that does what you want
    and run that instead.
     
    Tom Smith, Nov 30, 2004
    #2
  3. My client wants to eliminate the ability for salesmen to modify text on
    drawings created by my software. One salesman found out by accident that if
    they doubleclicked the text (an attribute) they could modify it.
     
    Dale Levesque, Nov 30, 2004
    #3
  4. Dale Levesque

    Matt W Guest

    hehehehe
     
    Matt W, Nov 30, 2004
    #4
  5. Dale Levesque

    doug k Guest

    you need to disable the salesmen instead.

     
    doug k, Nov 30, 2004
    #5
  6. Do you want them to be able to modify other things, but just not attributes?
    I would guess maybe not, in which case you could send them drawings in .pdf
    format (there's a nice freeware program that will make them called pdf995),
    or plot files, or.... In any case, I assume that even if you undefine
    eattedit in your AutoCAD program, that's not going to affect whether it
    works in someone else's -- the "undefinition" doesn't become part of the
    drawing file.
     
    Kent Cooper, AIA, Nov 30, 2004
    #6
  7. Did you say disable or disembowel? :)
     
    Dale Levesque, Nov 30, 2004
    #7
  8. I'm not sure how to use it Luis. How about a hint?
     
    Dale Levesque, Nov 30, 2004
    #8
  9. Dale Levesque

    Simon Wegner Guest

    How about turning off dblclkedit? If they were only able to figure out attedit by accident, I doubt they could find a system variable.
     
    Simon Wegner, Nov 30, 2004
    #9
  10. I modified the code, loaded the lisp file but the command is still active.
     
    Dale Levesque, Nov 30, 2004
    #10
  11. Dale Levesque

    ECCAD Guest

    Just give them a 'read-only' .dwg.
    :)
    If they are 'smart' enough to get around that. (fire them).

    Bob
     
    ECCAD, Nov 30, 2004
    #11
  12. The application actually creates drawings elevation and sectional details
    for custom windows and doors. The salesman only sees a limited menu
    neccesary to create the drawings and print them. They then get them signed
    by the customer for production and fax them to head office. A more
    sophisticated version of the application creates all production
    documentation.

    Best regards,

    Dale
     
    Dale Levesque, Nov 30, 2004
    #12
  13. (defun commandwillstart (reactor params / acad_obj)
    I didn't bother with the lispwillstart routine since it's a built-in
    command. As i step through the code, (car params) does indeed = "eattedit".
    (vl-load-com) is called before the routine is loaded.

    ;; here change the command name
    ;; aqui cambiar el nombre del comando
    (if (= (car params) "eattedit")
    (vla-eval (setq acad_obj (vlax-get-acad-object))
    (strcat "Sendkeys \"{ESC}\""))))

    (defun lispwillstart (reactor params / acad_obj)
    ;; here change the lisp name
    ;; aqui cambiar el nombre del lisp
    (if (= (car params) "(C:FC)")
    (vla-eval (setq acad_obj (vlax-get-acad-object))
    (strcat "Sendkeys \"{ESC}\""))))

    (if (not cmd_cancel_editor_reactor)
    (setq cmd_cancel_editor_reactor
    (vlr-editor-reactor
    nil
    '(:)vlr-commandwillstart . commandwillstart)))))

    (if (not cmd_cancel_lsp_reactor)
    (setq cmd_cancel_lsp_reactor
    (vlr-lisp-reactor
    nil
    '(:)vlr-lispwillstart . lispwillstart)))))

    (princ)
     
    Dale Levesque, Nov 30, 2004
    #13
  14. DWF? They can view it but not change it.
     
    Casey Roberts, Nov 30, 2004
    #14
  15. Oops. Sheesh. Thanks Luis.

     
    Dale Levesque, Nov 30, 2004
    #15
  16. Dale Levesque

    Paul Turvill Guest

    Unless they're going to view the drawings on *YOUR* computer, there's
    absolutely nothing you can do to modify or defeat any AutoCAD command. The
    command structure is firmly embedded in AutoCAD itself, not the drawing
    files it produces.
    ___
     
    Paul Turvill, Dec 1, 2004
    #16
  17. Dale Levesque

    Jimmy D Guest

    Hi Dale,

    A solution could be using VBA to trap the command. The routine is then attached to the drawing itself and no lisp file is needed.

    Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
    If CommandName = "ATTEDIT" Then
    MsgBox "Command is not allowed", vbCritical
    ThisDrawing.SendCommand Chr(3) 'break command with ESC
    End If
    End Sub
     
    Jimmy D, Dec 1, 2004
    #17
  18. Dale Levesque

    Tom Smith Guest

    Look into Owen Wengerd's CADLock program.
     
    Tom Smith, Dec 1, 2004
    #18
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.