prasanthbalu
2013-09-13, 10:06 AM
Hi all,
I am just new to Auto lisp .I have created a lisp routine for offset command as below. My intention is to show last entered cover value as default for offset distance. if we press enter it should accept the last entered value. somebody could help me to rearrange the lisp pattern. Thank you.
(defun c:cr()
(SETQ lyr (TBLSEARCH "LAYER" "COVER"))
(IF
(= lyr NIL)
(COMMAND "-LAYER" "M" "COVER" "C" "6" "" "P" "N" "" "")
(COMMAND "-LAYER" "S" "COVER" "P" "N" "" "")
);IF
(WHILE
(setq pt(getreal "\n Enter cover :"))
(setq so (entsel "\n Select Object To Offset"))
(setq pt1 (getpoint "\n Pick The Point To Offset"))
(command "OFFSET" pt so pt1 "")
);WHILE
(princ)
);DEFUN
I am just new to Auto lisp .I have created a lisp routine for offset command as below. My intention is to show last entered cover value as default for offset distance. if we press enter it should accept the last entered value. somebody could help me to rearrange the lisp pattern. Thank you.
(defun c:cr()
(SETQ lyr (TBLSEARCH "LAYER" "COVER"))
(IF
(= lyr NIL)
(COMMAND "-LAYER" "M" "COVER" "C" "6" "" "P" "N" "" "")
(COMMAND "-LAYER" "S" "COVER" "P" "N" "" "")
);IF
(WHILE
(setq pt(getreal "\n Enter cover :"))
(setq so (entsel "\n Select Object To Offset"))
(setq pt1 (getpoint "\n Pick The Point To Offset"))
(command "OFFSET" pt so pt1 "")
);WHILE
(princ)
);DEFUN