TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Biscuits on December 18, 2020, 11:12:50 AM

Title: Polar tracking question
Post by: Biscuits on December 18, 2020, 11:12:50 AM
MERRY CHRISTMAS!

We use this code to create outlines of houses on our aerial map drawings. I'm looking for suggestions as to how I can turn Polar tracking on after the first line segment has been drawn and still have a single polyline when finished. It gets pretty old having to repeatedly hit F10 and I'm getting lazier with age. Any help would be much appreciated. Thanks

Code: [Select]
(command "pline" (while (> (getvar 'cmdactive) 0) (command pause)))
Title: Re: Polar tracking question
Post by: Lee Mac on December 18, 2020, 01:04:48 PM
I might suggest something along the lines of the following:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:test ( / as p1 p2 )
  2.     (if (and (setq p1 (getpoint "\nSpecify start point: "))
  3.              (setq p2 (getpoint "\nSpecify next point: " p1))
  4.         )
  5.         (progn
  6.             (setq as (getvar 'autosnap))
  7.             (setvar 'autosnap (logior 8 (getvar 'autosnap)))
  8.             (vl-cmdf "_.pline" "_non" p1 "_non" p2)
  9.             (while (= 1 (logand 1 (getvar 'cmdactive))) (vl-cmdf "\\"))
  10.             (setvar 'autosnap as)
  11.         )
  12.     )
  13.     (princ)
  14. )
Title: Re: Polar tracking question
Post by: Biscuits on December 18, 2020, 02:22:25 PM
Absolutely perfect. Thank you so much for coming to the rescue once again!
Have a Merry Christmas and stay safe!!!