Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OSNAP doesn't work

28 views
Skip to first unread message

Pj

unread,
Oct 14, 2009, 3:34:31 AM10/14/09
to
Hi,
I need a help for a autolisp program:

--start---
(defun c:trat ()
(setq tt 0)
(setq trat (getreal "\nLunghezza tratteggio: "))
(while (= tt 0)
(setvar "OSMODE" 1)
(setq s1 (entsel "\nSeleziona la linea da tratteggiare\n"))
(setq ent (entget (car s1)))
(setq pt1 (cdr (assoc 10 ent)))
(setq pt2 (cdr (assoc 11 ent)))
(setq lung (distance pt1 pt2))
(command "_UCS" "_ob" s1)
(command "._ERASE" s1 "")
(setq pt1 nil)
(setq pt2 nil)
(setq pt1 (list 0 0 0))
(setq pt2 (list lung 0 0))
;(command "_line" pt1 pt2 "")
;(command "_UCS" "_w" "")
;------------------------
(setq x1 0)
(setq x2 lung)
(setq xa x1)
(setq xb (+ x1 trat))
;(while (or(< xb (max x1 x2)) (< xa (max x1 x2)))
(setvar "OSMODE" 0)
(while (< xb (- lung trat))
(print lung)
(print (- lung trat))
(print xb)
(print xa)
(setq pta (list xa 0 0))
(setq ptb (list xb 0 0))
(command "_line" pta ptb "")
(setq xa nil)
(setq xa (+ xb trat))
(setq xb nil)
(setq xb (+ xa trat))
(setq pta nil)
(setq ptb nil)
)
(setq pta (list xa 0 0))
(setq xb nil)
(setq xb x2)
(setq ptb (list xb 0 0))
(command "_line" pta ptb "")
(command "_ucs" "_w")
;(setvar "OSMODE" 1)
(command)
(command "-osnap" "END,MID,CEN,NOD,QUA,INT,INS,PERP,TAN,APP,EXT,PAR")
)
)
--end--
why the last command "-osnap" doesnt work?
Why if I use the command alone it works?
Thank's
Pj

Thomas Proppe

unread,
Oct 14, 2009, 7:06:19 AM10/14/09
to
Am 14.10.2009, 09:34 Uhr, schrieb Pj <sas...@tiscali.it>:

> Hi,
> I need a help for a autolisp program:
>

> ;(setvar "OSMODE" 1)


> (command)
> (command "-osnap" "END,MID,CEN,NOD,QUA,INT,INS,PERP,TAN,APP,EXT,PAR")

I think, you better use
(setvar "OSMODE" 11263)
if yyou really want to turn all snaps on!?

Thomas

Message has been deleted

strawberry

unread,
Oct 14, 2009, 7:29:45 AM10/14/09
to
> I think, you better use
> (setvar "OSMODE" 11263)
> if yyou really want to turn all snaps on!?
>
> Thomas

For me (using AutoCAD 2008), ALL = 15359 while the combo chosen by the
OP is 14847

0 new messages