TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: bman on July 12, 2005, 08:48:18 AM
-
Why aren't my osnaps setting to 0 prior to executing the circle command?
(defun c:cr3 (/ oldsnap)
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)
(setvar "osmode" 256)
(command "circle" "3p")
(setvar "osmode" oldsnap)
(princ)
)
-
Why aren't my osnaps setting to 0 prior to executing the circle command?
(defun c:cr3 (/ oldsnap)
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)
(setvar "osmode" 256)
(command "circle" "3p")
(setvar "osmode" oldsnap)
(princ)
)
(defun c:cr3 (/ oldsnap)
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)
(setvar "osmode" 256) ;; <-----------
(command "circle" "3p")
(setvar "osmode" oldsnap)
(princ)
)
-
bman
I don't understand your routine?
It appears as though you want to exit the routine before picking the three points. Is that true?
If not you need to pause to allow the user to pick the points else the osnaps will be reset
when the leave the routine.
You would need this:
(defun c:cr3 (/ oldsnap)
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)
(command "circle" "3p" pause pause pause)
(setvar "osmode" oldsnap)
(princ)
)
Or this:
(defun c:cr3 (/ oldsnap)
(command "circle" "3p"
"non" pause
"non" pause
"non" pause
)
(princ)
)
-
I was thinking more along these lines....
(defun c:cr3 (/ oldsnap)
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)
(command "circle" "3p" pause)
(while
(< 0 (getvar "CMDACTIVE"))
(command pause)
)
(setvar "osmode" oldsnap)
(princ)
)
-
I was trying to set the osmode to 0 & then to 256 prior to the circle command
This seems to work well
(defun c:cr3 (/ oldsnap)
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)
(prompt "\nSelect first tangent point: ")
(setvar "osmode" 256)
(command "circle" "3p" pause pause pause)
(setvar "osmode" oldsnap)
(princ)
)
-
There is no need to set OSMODE to 0 prior to setting it to 256.
-
As well, there's probably no reason to set it to anything except maybe zero as osmode's can all be overridden and if the user misses or snaps to the wrong point, he may have to escape & restart the routine.