Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to figure out the undo command in autolisp. I can't find any good documentation with examples although there are many posts on forums.
I cant get my head around Begin and Back. As far as I understood it does the same. But I can't make (command-s "._UNDO" "BE" ) to work in my code.
(command-s "._UNDO" "B" ) works fine.
Here is my code.
(defun C:InsertAtrLin () * * * * (defun C:VPTFL(/ *error*) (defun *error*(errmsg) (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break")) (princ (strcat "\nError: " errmsg)) ) (command-s "._UNDO" "B" ) (vl-bt) ) (setq *acad* (vlax-get-acad-object)) (setq Doc (vla-get-ActiveDocument *acad*)) (vla-startundomark Doc) ;(command "._UNDO" "_Begin" ) ;(command-s "._UNDO" "_End") (if (= rb 0) (progn (prompt "\nNacrtajte liniju!") (command "._PLINE") (while (eq 1 (logand 1 (getvar "CMDACTIVE"))) (command pause) ) (setq selline (entlast)) (setq ssline (ssadd)) (ssadd selline ssline) (C:choosecodeFL) (_lindata) (_lstyle) (C:InsertAtrLin) (C:appendatrfullline) ) ) (if (= 8 (logand (getvar 'undoctl) 8)) (princ "\nGroup is active!") (princ "\nGroup is not active!") ) (if (= rb 1) (progn (C:pickline) (C:choosecodeFL) (_lindata) (_lstyle) (C:InsertAtrLin) (C:appendatrfullline) ) ) ;(command "._UNDO" "_End") ;(command-s "._UNDO" "_Begin") (vla-endundomark Doc) ) (defun C:VPTIL() (if (= rb 0) (progn (prompt "\nNacrtajte liniju!") (command "._PLINE") (while (eq 1 (logand 1 (getvar "CMDACTIVE"))) (command pause) * * * * )
Solved! Go to Solution.