Steve,
Joe LeBaron's thread 9/1/01 called "Transparent Lisp Command (OSNAP)" might
be relevant?
Joe Burke
"Steve Adams" wrote in message
news:C54D0A22F309955D4B0E7F2A4E7C5287@in.WebX.maYIadrTaRb...
> Hi Everybody,
>
> I want to be able to toggle my osnap settings from 0 to 41,
> and vice versa, and I want this to be transparent. (even in lisp
routines).
>
> I wrote a little "if" test, and made a vlax command out of it
> to make it transparent. See below:
>
> (vl-load-com)
> (defun c:tgl (/ a)
> (setq a(getvar "osmode"))
> ;(setvar "cmdecho" 0)
> (if (/= a 41)
> (setvar "osmode" 41)
> (setvar "osmode" 0)
> ;;;(command "'-osnap" "end")
> ;;;(command "'-osnap" "non")
> )
> )
> (vlax-add-cmd "osmode-tgl" 'tgl "osmode-tgl" 1)
>
>
> My problem is:
> the setvar functions are sending their data (41 or 0)
> to the command I am in, and messing it up.
> For example, If I am in the "line" command, and I
> run the program "'TGL", it either sends the 41 and makes
> a line 41 units long, or sends the 0 and makes a 0 length line!
>
> Any ideas on how to make it stop? You can see I tried a couple
> of things that I have "commented out", but they didn't help.
>
> Any ideas on this, or alternate suggestions for doing this will
> be greatly appreciated.
>
> Thanks,
> Steve
>
>
>
>
>
>
>
>