TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on April 22, 2010, 11:51:49 AM

Title: Perpendicular OSNAP
Post by: Andrea on April 22, 2010, 11:51:49 AM
Hi all...

it's about a long time heun ?  ;-)
sorry, I'm very busy..

Well, I would like to know if anyone have a clue for this.

Code: [Select]
(while (eq (car (setq input (grread t 4 4))) 5)      
(setq vs (/ (getvar "Viewsize") 60.0))
(setq snappoint (osnap (cadr input) "_per"))
  (redraw)
(if snappoint
  (progn
  (grdraw (polar snappoint 3.92699 vs) (polar snappoint 0.785398 vs) 2 0)
  (grdraw (polar snappoint -0.785398 vs) (polar snappoint 2.35619 vs) 2 0)   
  )
)
)

any help will be appreciated.

Thanks.
Title: Re: Perpendicular OSNAP
Post by: Lee Mac on April 22, 2010, 11:53:34 AM
Would this post help?

http://www.theswamp.org/index.php?topic=12813.msg157601#msg157601 (http://www.theswamp.org/index.php?topic=12813.msg157601#msg157601)
Title: Re: Perpendicular OSNAP
Post by: Andrea on April 22, 2010, 01:29:42 PM
thanks Lee,

I've take a look and tested the code of Elpanov
.....but it seem to not working on 2011.

however, I've found some interesting snippet who maybe can help me for this issue....

  ;-)


thanks.
Title: Re: Perpendicular OSNAP
Post by: Lee Mac on April 22, 2010, 05:44:08 PM
Not a problem - that code helped me incorporate OSnap into my programs that run on GrRead (its not perfect, but it is a pretty good substitute) - GrRead with OSnap is on my wishlist  :-)
Title: Re: Perpendicular OSNAP
Post by: alanjt on April 22, 2010, 07:45:12 PM
- GrRead with OSnap is on my wishlist  :-)
It would definitely make them usable in a lot of situations.
Title: Re: Perpendicular OSNAP
Post by: Andrea on April 23, 2010, 11:21:46 AM
I,ve create my own grread SNAPS.....the only problem is the perpedicular one..
i'll try to found a solution..

When it'll be done....I'll post here..

thanks.
Title: Re: Perpendicular OSNAP
Post by: VovKa on April 23, 2010, 01:24:13 PM
the solution is "LASTPOINT"
Code: [Select]
(while (eq (car (setq input (grread t 4 4))) 5)
  (setq vs (/ (getvar "Viewsize") 60.0))
  (setq snappoint (osnap (cadr input) "_per"))
  (redraw)
  (if snappoint
    (progn (grdraw (polar snappoint 3.92699 vs) (polar snappoint 0.785398 vs) 2 0)
  (grdraw (polar snappoint -0.785398 vs) (polar snappoint 2.35619 vs) 2 0)
  (entmake
    (list (cons 0 "LINE") (cons 10 (getvar "LASTPOINT")) (cons 11 snappoint))
  )
  (setvar "LASTPOINT" snappoint)
    )
  )
)
Title: Re: Perpendicular OSNAP
Post by: Andrea on April 27, 2010, 11:49:45 AM
the solution is "LASTPOINT"
Code: [Select]
(while (eq (car (setq input (grread t 4 4))) 5)
  (setq vs (/ (getvar "Viewsize") 60.0))
  (setq snappoint (osnap (cadr input) "_per"))
  (redraw)
  (if snappoint
    (progn (grdraw (polar snappoint 3.92699 vs) (polar snappoint 0.785398 vs) 2 0)
  (grdraw (polar snappoint -0.785398 vs) (polar snappoint 2.35619 vs) 2 0)
  (entmake
    (list (cons 0 "LINE") (cons 10 (getvar "LASTPOINT")) (cons 11 snappoint))
  )
  (setvar "LASTPOINT" snappoint)
    )
  )
)

Thanks vovka..

That.s what I've done..
but with some additional condition.
like if there is no first pick point..

Thanks again.