Main Page | Report this Page
Computers Forum Index  »  Computer - Autocad  »  OSNAP doesn't work...
Page 1 of 1    

OSNAP doesn't work...

Author Message
Pj...
Posted: Wed Oct 14, 2009 7:34 am
Guest
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
 
strawberry...
Posted: Wed Oct 14, 2009 11:26 am
Guest
Quote:
I think, you better use
(setvar "OSMODE" 11263)
if yyou really want to turn all snaps on!?

Thomas

For me it's 15359
 
strawberry...
Posted: Wed Oct 14, 2009 11:29 am
Guest
Quote:
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
 
Thomas Proppe...
Posted: Wed Oct 14, 2009 3:06 pm
Guest
Am 14.10.2009, 09:34 Uhr, schrieb Pj <sasiap at (no spam) tiscali.it>:

Quote:
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

Quote:
why the last command "-osnap" doesnt work?
Why if I use the command alone it works?
Thank's
Pj
 
 
Page 1 of 1    
All times are GMT
The time now is Tue Dec 08, 2009 2:09 pm