Ok Lee,
I read your thread and I kinda get it but it seems when I put it to use on this big routine I get lost what is what. I added the while in and it loops, but it does not stop and finish the rest of the routine when I hit enter. And hitting esc gets it out but also does not finish the routine. So big question looking at what I have what am I missing? When I tried a few ways it just stopped looping.
(defun C:bdd (/); width depth membr suffix suffixs prx tsz depth width label label2 label1)(setq lsttsz ' ("11x17" "24x36") lstmembr '("Flush Beam" "Header" "Drop Beam") lstprxs '("CANT" "NOTHING") lstprx '("1 ply" "2 ply" "3 ply") lstmatrl '("6" "8" "10" "12") lstwidth '("1.5" "1.75" "3" "3.5" "4.5" "5.25" "7" "2.5") lstdepth '("5.5" "7.25" "9.25" "9.5" "11.25" "11.875" "14" "16" "18" "24" "I-JOIST/BEAM" "BBO") lstsuffix '("PSL" "LVL" "LSL") lstsuffixs '("FRB" "UWA" "UCA" "NOTHING" " W/ 2~5/8x16 STEEL PLATES (FLITCH BEAM)"));end setq (or tsz (setq tsz (car lsttsz))) (or membr (setq membr (car lstmembr)))(or prxs (setq prxs (car lstprxs)))(or prx (setq prx (car lstprx)))(or matrl (setq matrl (car lstmatrl))) (or width (setq width (car lstWidth)))(or depth (setq depth (car lstDepth)))(or suffix (setq suffix (car lstsuffix)))(or suffixs (setq suffixs (car lstsuffixs))) (setq dcl_id (load_dialog "linebeam.dcl")) (if (not (new_dialog "linebeam" dcl_id)) (exit)) (progn (set_tile tsz "1") (set_tile membr "1") (set_tile prxs "1") (set_tile prx "1") (set_tile matrl "1") (set_tile width "1") (set_tile depth "1") (set_tile suffix "1") (set_tile suffixs "1") (action_tile "tsz" "(setq tsz $value)") (action_tile "membr" "(setq membr $value)") (action_tile "prxs" "(setq prxs $value)") (action_tile "prx" "(setq prx $value)") (action_tile "matrl" "(setq matrl $value)") (action_tile "width" "(setq width $value)") (action_tile "depth" "(setq depth $value)") (action_tile "suffix" "(setq suffix $value)") (action_tile "suffixs" "(setq suffixs $value)"));end progn (start_dialog) (unload_dialog dcl_id) ;;;----set variables ------------------------------------- (setq layerset (getvar "clayer")orthoset (getvar "orthomode")polyset (getvar "plinewid"));ex(getvar "expert"));setq(command "expert" "1");------------What size text for border -------------------(while (if(= tsz "11x17") (setq tsz1 "6"))(if(= tsz "24x36")(setq tsz1 "4.5")) ;;;;;;;;;------------------------Which layer it draws the beam on----------------------;;;;;;;;;;;;;;;;;;;(if(= membr "Flush Beam") (progn;-------------Creat layers for beam-------- (command "_.layer" "M" "S-FRM-BEAM" "c" "12" "S-FRM-BEAM" "S" "S-FRM-BEAM" "");-----------------draw beams -------(command "line" pause pause "") (setq ln (ssget "_l" ' ((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))) (command "_.offset" "2" ln pause "") );end progn );end if (if(= membr "Drop Beam") (progn;-------------Creat layers for beam----------- (command "_.layer" "M" "S-FRM-HEADER" "c" "12" "S-FRM-HEADER" "S" "S-FRM-HEADER" "");-----------------draw beams --------------- (command "line" pause pause "") (setq ln (ssget "_l" ' ((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))) (command "_.offset" "2" ln pause "") );end progn );end if(if (= membr "Header") (progn;-------------Creat layers for beam------------ (command "_.layer" "M" "S-FRM-HEADER" "c" "12" "S-FRM-HEADER" "S" "S-FRM-HEADER" "") (command "_.line" pause pause "") );end progn );end cond ;----------change text size and style------------------- (command "textsize" tsz1 "")(command "_.style" "romans" "romans" "0" "0.80" "" "" "" "");-------------Creat layers for text------------------------------- (command "_.layer" "M" "S-ANNO-TEXT" "c" "1" "S-ANNO-TEXT" "S" "S-ANNO-TEXT" "") (and (setq ss (ssget "L" '((0 . "*line")))) (while (setq en (ssname ss 0)) (setq ed (entget en)) (setq p10 (cdr (assoc 10 ed))) (setq p11 (cdr (assoc 11 ed))) (setq mpt (mapcar '(lambda (a b) (* (+ a b) 0.5)) p10 p11)) ;(setq ltype (cdr (cond ; ((assoc 6 ed))))) ;(setq depth (cdr (cond ; ((assoc 39 ed))))) ;(setq width (cdr (cond ; ((assoc 40 ed)))));---------Prxs ----------(cond((= prxs "CANT ")(setq label3 "CANT "))((= prxs "")(setq label3 "")));end cond;---------How many plys the member has----------(cond ((= prx "1 ply") (and (< width "1.75")(setq label2 ""))) ((= prx "2 ply")(setq label2 "2~")) ((= prx "3 ply")(setq label2 "3~")) );end cond;---------2x material---------------------------(cond ((= matrl "6")(setq label4 "2x6" suffix ""));(rtos depth 2 0))) ((= matrl "8")(setq label4 "2x8" suffix ""));(rtos depth 2 0))) ((= matrl "10")(setq label4 "2x10" suffix ""));(rtos depth 2 0))) ((= matrl "12")(setq label4 "2x12" suffix ""));(rtos depth 2 0))) ;((= matrl "0")(setq label4 "")) );end cond;----------Width of the member--------- (cond ;((= width "1.5")(setq label "2x" ;suffix "")) ((= width "1.75")(setq label "1.75x")) ((= width "2.5")(setq label "I-JOIST/BEAM" label2 "" depth "0" suffix "" label4 "")) ; ((= width "3")(setq label "2x" ;suffix "" )) ((= width "3.5")(setq label "3.5x" label2 "" label4 "")) ;((= width "4.5")(setq label "2x" ; suffix "")) ((= width "5.25")(setq label "5.25x" label2 "" label4 "")) ((= width "7")(setq label "7x" label2 "" label4 "")) ((= width "2")(setq label "BBO" label2 "" depth "0" suffix "" label4 "")) ((= width "0")(setq label "")) );end cond;----------Depth of the Member------------- (cond ((= depth "5.5")(setq label1 "5.5" matrl ""));(rtos depth 2 1))) ((= depth "7.25")(setq label1 "7.25" matrl ""));(rtos depth 2 2))) ((= depth "9.25")(setq label1 "9.25" matrl ""));(rtos depth 2 2))) ((= depth "9.5")(setq label1 "9.5" matrl ""));(rtos depth 2 1))) ((= depth "11.25")(setq label1 "11.25" matrl ""));(rtos depth 2 2))) ((= depth "11.875")(setq label1 "11.875" matrl ""));(rtos depth 2 3))) ((= depth "14")(setq label1 "14" matrl ""));(rtos depth 2 0))) ((= depth "16")(setq label1 "16" matrl ""));(rtos depth 2 0))) ((= depth "18")(setq label1 "18" matrl ""));(rtos depth 2 0))) ((= depth "24")(setq label1 "24" matrl "")) ;(rtos depth 2 0))) ((= depth "0")(setq label1 "" matrl "")));end cond;(cond ;((= suffixs "36")(setq suffixs " W/ 2~5/8x"label1 "STEEL PLATES (FLITCH BEAM)")) ;end cond (defun radians->degrees (r)(cvunit r "radian" "degree")) ;-------TEXT JUSTIFICATION---------------------------------------- (setq lan (angle p10 p11)) (setq ad (radians->degrees lan)) (if (and (> ad 90.1) (degrees lan)))) (setq dir (if (< (* pi 0.5) lan (* pi 1.5)) - +)) (setq r3(entmake (list (cons 0 "TEXT") (cons 8 (getvar "CLAYER")) (cons 7 (getvar "TEXTSTYLE")) (cons 40 (getvar "TEXTSIZE")) (cons 41 0.80) (cons 72 4) (setq fg(cons 10 ' (0.0 0.0)));(setq r1(polar mpt (dir lan (+ 1)) ;(getvar "TEXTSIZE"))))) (setq hg(cons 11 (setq r2(polar mpt (dir lan (* 0.5 pi));(+ 1)) (+ (* 0.5 (atof width)) (* 0.8 (getvar "TEXTSIZE"))))))) (setq gg(cons 50 lan)) (setq rg(cons 1 (strcat label3 label2 label label4 label1 suffix suffixs)))))) (ssdel en ss)));end and );end while ;---------------------reset vars-----------(setvar "clayer" layerset)(setvar "orthomode" orthoset) (setvar "plinewid" polyset) ;(setvar "expert" ex)(command "expert" "0" "") (princ))(Princ "\nType BDD [Enter] to run. Version:3.00")(princ)
linebeam : dialog {label = "Pick a Member" " " "Version 3.00";: row { : row { fixed_width = true; : boxed_radio_row {key = "tsz"; label = "Text Size"; : radio_button { label = "11x17 (6)"; key = "11x17"; } : radio_button { label = "24x36 (4.5)"; key = "24x36"; }}} : row { fixed_width = true; : boxed_radio_row {key = "membr"; label = "Type of Member"; : radio_button { label = "Flush Beam"; key = "Flush Beam"; } : radio_button { label = "Drop Beam"; key = "Drop Beam"; } : radio_button { label = "Header"; key = "Header"; }}}} : row { : row { : boxed_radio_row {key = "prxs"; label = "Preffix"; : radio_button { label = "CANT"; key = "CANT "; } : radio_button { label = "NOTHING"; key = ""; }}} : row { : boxed_radio_row {key = "prx"; label = "Plys"; : radio_button { label = "1 Ply"; key = "1 ply"; } : radio_button { label = "2 Ply"; key = "2 ply"; } : radio_button { label = "3 Ply"; key = "3 ply"; }}}} : row { : boxed_radio_row {key = "matrl"; label = "2x Material"; fixed_width = true; : radio_button { label = "2x6"; key = "6"; } : radio_button { label = "2x8"; key = "8"; } : radio_button { label = "2x10"; key = "10"; } : radio_button { label = "2x12"; key = "12"; } }} : row { : boxed_radio_row {key = "width"; label = "Width"; fixed_width = true; : radio_button { label = "1.75"; key = "1.75"; } : radio_button { label = "3.5"; key = "3.5"; } : radio_button { label = "5.25"; key = "5.25"; } : radio_button { label = "7"; key = "7"; } : radio_button { label = "I-JOIST/BEAM"; key = "2.5"; } : radio_button { label = "BBO"; key = "2"; }}} : row { fixed_width = true; : boxed_radio_row {key = "depth"; label = "Depth"; : radio_button { label = "5.5"; key = "5.5"; } : radio_button { label = "7.25"; key = "7.25"; } : radio_button { label = "9.25"; key = "9.25"; } : radio_button { label = "9.5"; key = "9.5"; } : radio_button { label = "11.25"; key = "11.25"; } : radio_button { label = "11.875"; key = "11.875"; } : radio_button { label = "14"; key = "14"; } : radio_button { label = "16"; key = "16"; } : radio_button { label = "18"; key = "18"; } : radio_button { label = "24"; key = "24"; }}} : boxed_radio_row {key = "suffix"; label = "Product"; fixed_width = true; : radio_button { label = "PSL"; key = " PSL"; } : radio_button { label = "LVL"; key = " LVL"; } : radio_button { label = "LSL"; key = " LSL"; } } : row { : boxed_radio_row {key = "suffixs"; label = "Suffix"; fixed_width = true; : radio_button { label = "FRB"; key = " FRB"; } : radio_button { label = "UWA"; key = " UWA"; } : radio_button { label = "UCA"; key = " UCA"; } : radio_button { label = "FLITCH BEAM"; key = " W/ 2~5/8x16 STEEL PLATES (FLITCH BEAM)"; } : radio_button { label = "NOTHING"; key = ""; }}} : row { : button { label = "&OK"; key = "accept"; fixed_width = true; is_default = true; } : paragraph { :text_part { label = "PTS Inc."; fixed_width = true; alignment = centered; } :text_part{ label = " "; }} : button { label = "&Cancel"; key = "cancel"; fixed_width = true; is_cancel = true; }} }