0 Members and 1 Guest are viewing this topic.
(defun goto_INGcommand () (if (eq g "ING_SAVE") (progn (initdia 1) (command "_saveas"))))(defun INGcommand () (setq g nil) (while (progn (setq g (vl-catch-all-apply 'getstring (list "INGcommand: "))) (cond ((vl-catch-all-error-p g) ; yes, error (alert "Escape not allowed.") t ; stay in loop ) ((vl-string-search "ING" (setq g (strcase g))) (goto_INGcommand) nil ; exit loop & return the INGcommand entered. ) ((eq g "COMMAND") (exit) ; bye bye ) (t (alert "Invalid ING command.\n Type \"Command\" to return to AutoCAd command." ) t ) ) ) ) g)(setq cmd (INGcommand))
(defun INGcommand(/ g) (while (setq g (vl-catch-all-apply 'getstring (list "\nINGcommand: "))) (if (not (vl-catch-all-error-p g)) (progn (setq g (strcase g)) (if (vl-string-search "ING" g) (ing_go g) ) (if (eq g "COMMAND")(exit)) (if (and (not (vl-string-search "ING" g)) (not (eq g "COMMAND"))) (alert "Invalid ING command.\n Type \"Command\" to return to AutoCAd command.") ) ) (if (member (vl-catch-all-error-message g) (list "Fonction annulée" "Function cancelled")) (setq g T) (setq g nil) ) ) ))(defun ing_go (g1) (if (eq g1 "ING_SAVE") (progn (initdia 1) (command "_saveas")) ))(INGcommand)
(defun INGcommand (/ g) (while (progn (setq g (vl-catch-all-apply 'getstring (list "INGcommand: "))) (cond ((vl-catch-all-error-p g) ; yes, error (alert "Escape not allowed.") t ; stay in loop ) ((vl-string-search "ING" (setq g (strcase g))) (alert "You have entered a ING command") nil ; exit loop & return the INGcommand entered. ) ((eq g "COMMAND") (exit) ; bye bye ) (t (alert "Invalid ING command.\n Type \"Command\" to return to AutoCAd command." ) t ) ) ) ) g)(defun c:test (/ cmd) (setq cmd (INGcommand)) (cond ((eq cmd "ING_SAVE") (initdia 1) (command "_saveas") ) (t (alert "Invalid ING Command") ) ))
Works for me.
Quote from: CAB on October 10, 2006, 12:09:32 PMWorks for me. hug ?.. hmm....bizzarre..!..Thanks CAB nice try !..
Andrea did you copy the second test routine without any changed & test it?
Works for me. Code: [Select](defun INGcommand (/ g) (while (progn (setq g (vl-catch-all-apply 'getstring (list "INGcommand: "))) (cond ((vl-catch-all-error-p g) ; yes, error (alert "Escape not allowed.") t ; stay in loop ) ((vl-string-search "ING" (setq g (strcase g))) (alert "You have entered a ING command") nil ; exit loop & return the INGcommand entered. ) ((eq g "COMMAND") (exit) ; bye bye ) (t (alert "Invalid ING command.\n Type \"Command\" to return to AutoCAd command." ) t ) ) ) ) g)(defun c:test (/ cmd) (setq cmd (INGcommand)) (cond ((eq cmd "ING_SAVE") (initdia 1) (command "_saveas") ) (t (alert "Invalid ING Command") ) ))
(defun loadFreactor ()(vl-load-com) (vlr-command-reactor nil '((:vlr-commandWillStart . startFCommand))) )(defun startFCommand (getcommand / CMD) (setq CMD (nth 0 getcommand)) (cond ((and (/= CMD "TEXT") (/= CMD "MTEXT") (/= CMD "DTEXT") ) (progn (alert "Command disable.") (exit) ) )))(loadFreactor)
ok guys...I think i have wrong start...The program that i'm trying to do...is to permit only some AutoCad function to the user...like:_SAVEAS_OPEN_PLOT_PREVIEW_LINE_PLINE...and some few other...before continuing this project..is this program a good way to do it ?need your experience. :kewl:
(command "undefine" "circle")