Accoes Posted December 3, 2008 Share Posted December 3, 2008 Hi all I've been trying to create a lisp with the revcloud command.Everything prior to this command works,but once it gets to revcloud the lisp will terminate after the cloud is drawn.I need to add one more command to reset the ucs to world.I would like to use the acad command and not a home built. Quote Link to comment Share on other sites More sharing options...
lpseifert Posted December 3, 2008 Share Posted December 3, 2008 Try putting this after the revcloud command and before the UCS (while (> (getvar 'CmdActive) 0) (command pause)) BTW... it would be easier to debug code if you actually posted it. Quote Link to comment Share on other sites More sharing options...
Accoes Posted December 3, 2008 Author Share Posted December 3, 2008 Thanks,work great.Next time i'll post as i had not commented it Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 3, 2008 Share Posted December 3, 2008 Not sure if this is of any use? : ;| .: Revision Marker :. .: by Lee McDonnell:. .: December 2008 :. SYNTAX: REV BASE VARIABLES SYNTAX: REVSET |; (defun c:rev () (c:RevisionMarker)) ; Program Shortcut (defun Laymake () (if (not (tblsearch "layer" "REV")) (progn (command "-layer" "m" "REV" "c" "2" "REV" "") (princ "\nCreating Revision Layer: ") ) ;_ end progn (setvar "clayer" "REV") ) ;_ end if ) ;_ end defun (defun c:RevisionMarker (/ *error* varLst oldVars revpt pt1 txt txtpt) ; --- Error Trap --- (defun *error* (msg) (mapcar 'setvar varLst oldVars) (if (= msg "") (princ "\nFunction Complete.") (princ "\nError or Esc pressed... ") ) ;_ end if (princ) ) ;_ end defun ; --- Error Trap --- (or (getenv "Rev:Side") (setenv "Rev:Side" "6")) (or (getenv "Rev:Text") (setenv "Rev:Text" "2.5")) (or (getenv "Rev:Amin") (setenv "Rev:Amin" "2")) (or (getenv "Rev:Amax") (setenv "Rev:Amax" "2")) (princ (strcat "\nType \"RevSet\" to set Base Variables - Current Settings: \nSide Length: " (getenv "Rev:Side") ", Text Height: " (getenv "Rev:Text") ", Arc Length Min: " (getenv "Rev:Amin") ", Arc Length Max: " (getenv "Rev:Amax") ) ;_ end strcat ) ;_ end princ (setq varLst (list "CMDECHO" "CLAYER" "BLIPMODE" "OSMODE") oldVars (mapcar 'getvar varLst) ) ;_ end setq (setvar "cmdecho" 0) (setvar "blipmode" 0) (Laymake) (command "_revcloud" "A" (atof (getenv "Rev:Amin")) (atof (getenv "Rev:Amax")) ) ;_ end command (while (> (getvar "CmdActive") 0) (command pause)) (setvar "osmode" 0) (if (and (/= (setq pt1 (getpoint "\nSelect Point for Rev Triangle: " ) ;_ end getpoint ) ;_ end setq nil ) ;_ end /= (/= (setq txt (getstring t "\nSpecify Text for Rev Triangle: " ) ;_ end getstring ) ;_ end setq "" ) ;_ end /= ) ;_ end and (progn (setq txt (strcase txt)) (command "_.pline" "_non" pt1 "_non" (polar pt1 (/ (* -1 pi) 3) (atof (getenv "Rev:Side")) ) ;_ end polar "_non" (polar pt1 (/ (* -2 pi) 3) (atof (getenv "Rev:Side")) ) ;_ end polar "_C" ) ;_ end command (setq txtpt (polar pt1 (/ (* pi 3) 2) (/ (/ (atof (getenv "Rev:Side")) 2) (cos (/ pi 6)) ) ;_ end / ) ;_ end polar ) ;_ end setq (entmake (list '(0 . "TEXT") '(8 . "REV") (cons 10 txtpt) (cons 40 (atof (getenv "Rev:Text"))) (cons 1 txt) '(50 . 0.0) '(7 . "STANDARD") '(71 . 0) '(72 . 1) '(73 . 2) (cons 11 txtpt) ) ; end list ) ; end entmake ) ;_ end progn ) ;_ end if (*error* "") (princ) ) ;_ end defun (defun c:RevSet (/ side text amin amax) (or (getenv "Rev:Side") (setenv "Rev:Side" "6")) (or (getenv "Rev:Text") (setenv "Rev:Text" "2.5")) (or (getenv "Rev:Amin") (setenv "Rev:Amin" "2")) (or (getenv "Rev:Amax") (setenv "Rev:Amax" "2")) (princ (strcat "\nCurrent Settings: \nSide Length: " (getenv "Rev:Side") ", Text Height: " (getenv "Rev:Text") ", Arc Length Min: " (getenv "Rev:Amin") ", Arc Length Max: " (getenv "Rev:Amax") ) ;_ end strcat ) ;_ end princ (if (setq side (getreal (strcat "\nSpecify Side Length <" (getenv "Rev:Side") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "Rev:Side" (rtos side)) ) ;_ end if (if (setq text (getreal (strcat "\nSpecify Text Height <" (getenv "Rev:Text") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "Rev:Text" (rtos text)) ) ;_ end if (if (setq amin (getreal (strcat "\nSpecify Min Arc Length <" (getenv "Rev:Amin") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "Rev:Amin" (rtos amin)) ) ;_ end if (if (setq amax (getreal (strcat "\nSpecify Max Arc Length <" (getenv "Rev:Amax") "> : " ) ;_ end strcat ) ;_ end getreal ) ;_ end setq (setenv "Rev:Amax" (rtos amax)) ) ;_ end if (princ "\nBase Variables Set. ") (princ) ) ;_ end defun (princ "\nRevision Marker by Lee Mac Loaded. Type \"REV\" to Invoke." ) ;_ end princ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.