Search the Community
Showing results for tags 'studs'.
-
So I have tried to modify a batt insulation lsp originally created by David Sides to draw studs. You would think this would be easy because all I need are 45 degree lines, but I am having some trouble. I have gotten it to work for Horizontal walls and it is ok for vertical walls a bit glitchy but not horrible. Walls at an angle on the otherhand are horrible. Any advice? ;; STUD.LSP ;; ;;========================================================== (setq xos (getvar "osmode")) (setvar "osmode" 0) (defun SSV (savelist) (mapcar '(lambda (sysvar) (list sysvar (getvar sysvar)) ) savelist) ) (setq lista '("aunits" "auprec" "blipmode" "cmdecho" "orthomode")) ;;========================================================= (defun RSV (savelist) (mapcar '(lambda (sysvar) (setvar (car sysvar)(cadr sysvar)) (car sysvar) ) savelist) ) ;;========================================================== (defun HI () (setq olderr *error*) (defun *error* (errstr) (print errstr)(princ) (setq lista (RSV lista)) (setq *error* olderr) (princ) ) (setq lista (SSV lista)) (setvar "aunits" 3) (setvar "auprec" (setvar "blipmode" 0) (setvar "cmdecho" 0) (setvar "orthomode" 0) (prompt "\nArchitectural studs. ") (prompt "\nBy Alison Baillargeon. July 12, 2011. ") (princ) ) ;;============================================================ (defun BYE () (setq lista (RSV lista)) (setq *error* olderr)(princ) (princ "\nProcessing complete. ") (princ) ) ;;============================================================ (defun c:STUD (/ A ANG1 ANG2 ANG3 LEN1 LEN2 PT1 PT2 PT3 PT4 PT5 THK1 THK2 THK3 THK4) (HI) (setq PT1 (getpoint "\nEnter start point... ") PT2 (getpoint PT1 "\nEnter end point. ") THK1(getreal "\nEnter wall thickness. ") THK2(* THK1 THK1) THK3(+ THK2 THK2) THK4(sqrt THK3) LEN1(distance PT1 PT2) LEN2(/ LEN1 THK1) ANG1(angle PT1 PT2) ANG2(+ ANG1 0.7854) ANG3(+ ANG1 5.4977) a 0 ) (while (< a LEN2) (if (= a 0) (progn (setq PT3 (polar PT1 ANG2 THK4) PT4 (polar PT3 ANG3 THK4) PT5 (polar PT4 ANG2 THK4) A 0.5 ) (command ".pline" PT1 "w" 0.0 0.0 PT3 PT4) ) (progn (setq PT3 PT5 PT4 (polar PT3 ANG3 THK4) PT5 (polar PT4 ANG2 THK4)) (command PT3 PT4) (setq a (+ a 2)) ) ) ) (command "") (command ".break" "l" PT4 (polar PT4 ANG1 THK4)) (BYE) (setvar "osmode" xos) (princ) )