TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: subbup on June 22, 2004, 01:17:21 AM
-
Hello all,
I don't want allow delete operation in a drawing.
Can any one tell me how to do this
-
(1) Cut off CAD Operator's hands
(2) Outlaw use of Delete.
(3) Make drawing(s) read-only.
(4) Put drawing(s) in read-only directory.
(5) Use 3rd party tool like CadLock (http://www.cadlock.com).
(6) Reactor the set-up to death, see (1).
-
Here is a small demonstration for using Reactors to react to a command. Setting up a application to react to all the delete commands would be kinda indepth but you can if you want.
(vl-load-reactors)
(vlr-command-reactor nil '((:vlr-CommandWillStart . StartCommand)))
(defun StartCommand (calling-reactor startcommandinfo / thecommandstart)
(setq thecommandstart (nth 0 startcommandInfo))
(cond
((= thecommandstart "LINE")
(theswamp)
)
((= thecommandstart "SAVE")
(vlr-remove-all :vlr-command-reactor)
)
((= thecommandstart "QSAVE")
(vlr-remove-all :vlr-command-reactor)
)
)
)
(defun theswamp ()
(alert "Please wait unitll direct you to TheSwamp...")
(startapp "explorer" "http://www.theswamp.org/phpBB2/")
(alert "You may now continue with your line.
To cancle this reactor use the save command.")
(princ)
)
-
Just 2 cents. You might as well just use a viewer if the question really says what I think it says.
A vast amount of simple operations are depending on deletion of entities. A simple mirror command would be terribly restrained without deletion. As would working with blocks, texts, dimensions etc. etc.
-
Oooh good point Stig.
-
what exactly i want to do is whenever USER STARTS a DELETE command or hitting delete key in keyboard, the operation should be cancelled.
I think we can handle this with reactors.
Thank you Se7en.
-
but you might take Stig's concern to heart. Reactors might, as he says not allow a mirror command to work if you don't want to leave the original objects in the drawing. If you don't have a strong understanding of how things happen in autocad, like what it takes to perform a mirror, you surely don't want to start messing with reactors. Also, if you don't have a sound understanding of lisp, you don't want to start off with reactors. If, on the other hand, you do have a sound understanding of these things, then have fun.
-
I agree with Stig on this one. It would be a whole lot easier to go get a viewer.
***
As i re-read your post, you say that you want to disable in a drawing[/b] ...if you mean that litterly, your getting into persistant reactors. (I wouldnt mess with those.)
-
Hello all,
I don't want allow delete operation in a drawing.
Can any one tell me how to do this
Hi...
Loook all post here:
http://www.hispacad.com/foro/viewtopic.php?t=3688&postdays=0&postorder=asc&start=30