; LWALL.LSP [Article Figure 4] (c)1990, Barry Bowen ; ********************************************************** ; LWALL ; Copyright (c) Barry R. Bowen 1990 ; ---------------------------------------------------------- ; Variables: ; ANG = Offset angle ; ANG1 = Angle of first wall line from PT2 PT4 ; ANG2 = Angle of next offset ; ANG3 = Angle PT1 to PT7 ; ANG4 = Angle from PT7 to PT6 ; ANS = Variable for questions ; DIST = Distance from PT2 PT4 ; DIST1 = Distance from PT1 PT3 ; DIST2 = New distance from PT1 to PT7 ; PT1 = Begining offset point ; PT2 = Ending offset point/Begining wall point ; PT3 = Point for wall thickness ; PT4 = Inside point of first wall ; PT5 = Inside point of second wall ; PT6 = Outside point of second wall ; PT7 = Outside point of second wall ; PT8 = Inside wall point for additional offset ; WLTK = Current wall thickness [Global] ; ---------------------------------------------------------- (defun C:LWALL (/ ANS ANG ANG1 ANG2 ANG3 ANG4 DIST DIST1 ; 1 DIST2 PT1 PT2 PT3 PT4 PT5 PT6 PT7) ; 2 (WSTART) ; 3 (initget 1 "I O") ; 4 (setq ANS ; 5 (getkword "\nDraw Wall From nside or utside: ")) ; 6 (setvar "osmode" 1) ; 7 (setq PT1 (getpoint "\nOffset From (Endp): ")) ; 8 (setvar "osmode" 0) ; 9 (setq PT2 (getpoint PT1 "\nDistance/Angle: ") ;10 ANG (ANGLE PT1 PT2)) ;11 (cond ;12 ((= ANS "I") (setq PT3 (polar PT2 ANG WLTK)) ;13 (command "break" PT2 PT3) ;14 (setq DIST1 (distance PT1 PT3) ;15 PT4 (getpoint PT2 "\nLength Of Wall Inside: ");16 ANG1 (angle PT2 PT4) ;17 DIST (distance PT2 PT4) ;18 PT5 (polar PT1 ANG1 DIST) ;19 PT6 (polar PT5 ANG1 WLTK) ;20 PT7 (polar PT6 ANG DIST1)) ;21 (command "break" PT5 PT6 ;22 "line" PT2 PT4 PT5 "" "line" PT3 PT7 PT6 "") ;23 ) ;24 ((= ANS "O") (setq PT3 PT2) ;25 (setq PT2 (polar PT2 (+ ANG pi) WLTK) ;26 DIST1 (distance PT1 PT2)) ;27 (command "break" PT2 PT3) ;28 (setq PT7 (getpoint PT3 "\nLength Of Wall Outside: ") ;29 ANG1 (angle PT3 PT7) ;30 DIST (distance PT3 PT7) ;31 PT5 (polar PT1 ANG1 (- DIST WLTK)) ;32 PT6 (polar PT5 ANG1 WLTK)) ;33 (command "break" PT5 PT6) ;34 (setq PT4 (polar PT5 ANG DIST1)) ;35 (command "line" PT2 PT4 PT5 "" "line" PT3 PT7 PT6 "") ;36 ) ;37 ) ;38 (setq next (getstring "\nOffset From This Point : ")) ;39 (if (/= NEXT "") (progn ;40 (setq ANG4 (angle PT7 PT6) ;41 PT1 PT7 ;42 PT7 (getpoint PT1 ;43 "\nDistance To Outside of wall: ") ;44 ANG3 (angle PT1 PT7) ;45 DIST2 (distance PT1 PT7) ;46 ANG2 (angle PT7 PT1)) ;47 (cond ;48 ((= ANG3 ANG1) (setq PT3 (polar PT6 ANG3 DIST2) ;49 PT5 (polar PT3 ANG2 WLTK) ;50 PT8 (polar PT4 ANG3 WLTK))) ;51 ((= ANG3 ANG) (setq PT3 (polar PT3 ANG3 DIST2) ;52 PT5 (polar PT3 ANG2 WLTK) ;53 PT8 (polar PT4 ANG3 WLTK))) ;54 ) ;55 (setq PT6 (polar PT8 ANG3 (- DIST2 WLTK))) ;56 (command "break" PT5 PT3 "break" PT8 PT1 ;57 "line" PT5 PT6 PT8 "" "line" PT3 PT7 "" ;58 "fillet" PT7 PT1) ;59 )) ;60 (V1R) ;61 (RL) ;62 (V4) ;63 ) ;64