Before the command set the osnap mode to what you need.
(setvar "osmode" 1) ; endpoint
(setvar "osmode" 2) ; midpoint
(setvar "osmode" 3) ; endpoint,midpoint
(setvar "osmode" 4) ;center
(setvar "osmode" 5) ; endpoint,center
etc.....
You should also use (setq osmode (getvar "osmode")) before setting osmode
and (setvar "osmode" osmode) at the end of the function so that it is reset
to whatever the user was using.
"ffejgreb" wrote in message
news:40350dfc$1_3@newsprd01...
> I am writing a routine that is a series of autocad commands wrapped in a
> defun. I would like to force an osnap at certain points in the commands
> where you would be pausing for user input, but can't figure out how to do
> it. Below is the routine. Before anyone comments on the formatting of
the
> program, the book I am using to teach myself (ABC's of AutoLISP) uses this
> convention and it makes sense to me. I would like to use NEAREST when
> setqing p1 & p2 and use ENDPOINT when completing A2 (this would snap to
the
> end of the arc of A1). I have another issue with the routine, but if I
> could get help with these items I would be very appreciative.
>
> (defun c:slo (/ osold)
> (setq osold (getvar "osmode"))
> (setvar "osmode" 0)
> (LS)
> (A1)
> (A2)
> (L1)
> (setvar "osmode" osold)
> )
>
> (defun LS ()
> (if (not (tblsearch "layer" "slope"))
> (command "-layer" "n" "SLOPE" "c" "1" "SLOPE" "s" "SLOPE" "")
> )
> )
>
> (defun A1 (/ p1)
> (setq p1 (getpoint "\nPick start point for first ARC: "))
> (command "_.arc" p1 pause pause)
> )
>
> (defun A2 (/ p2)
> (setq p2 (getpoint "\nPick start point for second ARC: "))
> (command "_.arc" p2 pause pause)
> )
>
> (defun L1 ()
> (command "_.line" "" pause "")
> )
>
>