help sought on a lisp routine,
below i have attached a little routine that i have been banging my head over for the last few hours.
i run into difficulties when i get as far as calculating angles.
i can get it to extract the angles that i need, but i then want to draw a line @ point p2 90 degrees away from line pt1 pt2. the start point of this new line is at pt 2 and will have a distance inputted by the user.
can anyone shed some light. i think i might have to convert the angle back into radians but i am have problems wiht that as well.
any help would be greatly appreciated
(defun c:1()
(setq layerold(getvar "clayer")); get the current layer
(setq offdistold(getvar "offsetdist")); get the offset distance
(command "-layer" "make" "windows_doors" "c" "6" "" "" ); set the proper layer
(setq ope(getreal "\nenter the actual ope size..."))
(setq oldsnap(getvar "osmode"))
(setvar "osmode" 512)
(princ "\n pick the 1st point of the ope...")
(setq p1(getpoint))
(setvar "osmode" 128)
(princ "\n pick the 2nd point of the ope...")
(setq p2(getpoint p1 ))
(command "line" p1 p2 ""); draw line form point pt1 to pt2
(setq wallwidth(distance p1 p2))
(setq rad1(angle p1 p2))
(setq ang1(/ (* rad1 180)pi))
(setq ang2(- ang1 90))
(setq p3 (polar p2 ang2 ope))
(command "line" p2 p3 "")
)