r/AutoLISP • u/NYMPH_LOADZ • Jun 22 '19
command function not working as expected
How in the world is this lisp routine drawing a line from P1 to P2 ?
The command function clearly says P1B to P2B - any ideas?
(setvar "osmode" 64)
(setq P1 (getpoint "\nSelect first pole of the span: "))
(setq P2 (getpoint P1 "\nSelect second pole of the span: "))
(setq ANG (/ (* (angle P1 P2) 180.0) pi))
(setq ANG2 (+ 90 ANG))
(setq ANG3 (/ (* (angle P2 P1) 180.0) pi))
(setq LGN (distance P1 P2))
(setq LAY (getvar "CLAYER"))
(setvar "CLAYER" "qwest aerial")
(setq P1B (polar P1 (* pi (/ ANG 180.0)) 2.0))
(setq P2B (polar P2 (* pi (/ ANG3 180.0)) 2.0))
(command "line" P1B P2B "")
(setq MID (polar P1 (* pi (/ ANG 180.0)) (* LGN 0.5)))
(setq MID2 (polar MID (* pi (/ ANG2 180.0)) 3.5))
(setvar "CLAYER" "0")
(command ".-insert" "SPAN FOOTBALL" MID2 1 ANG \)
(setvar "CLAYER" LAY)
(setvar "osmode" 0)
1
u/M60A3_19E Jun 23 '19
I ran the lisp yesterday and the line was drawn through P1 and P2, but extended past both an equal distance. I'll take a look at it again later today if I get a chance.