Author Topic: Perpendicular OSNAP  (Read 2901 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Perpendicular OSNAP
« 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.
Keep smile...

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Perpendicular OSNAP
« Reply #1 on: April 22, 2010, 11:53:34 AM »

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Perpendicular OSNAP
« Reply #2 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.
Keep smile...

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Perpendicular OSNAP
« Reply #3 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  :-)

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Perpendicular OSNAP
« Reply #4 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.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Perpendicular OSNAP
« Reply #5 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.
Keep smile...

VovKa

  • Water Moccasin
  • Posts: 1632
  • Ukraine
Re: Perpendicular OSNAP
« Reply #6 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)
    )
  )
)
« Last Edit: April 23, 2010, 02:44:38 PM by VovKa »

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Perpendicular OSNAP
« Reply #7 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.
Keep smile...