;;;Draws Hiding Handrail ;;; ;;;Requires: MKLAYR.LSP, UUTILS.LSP ;;;Hiding requires: HDCIRC.DWG, HDBOX.DWG, 1X1.BMP ;;; ;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 8-22-96 ;;;> EDITED: 10-06-2005 ;;; (DEFUN c:hrail (/ made_some_lines temp_ss arc_end1 arc_end2 hr_pnt_lst nxt_hr_pnt hr_pnt1 hr_pnt2 hr_pntl1 hr_pntl2 hr_pntr1 hr_pntr2 hr_ang1 hr_ang2 hrll_nxt1 hrrl_nxt1 ;;; hrpt_end1 ;"Round Point Flat Open" ;;; hrpt_end2 ;"Round Point Flat Open" ;;; hrpt_hide ;"Yes No" ;;; hrpt_od ;1.9 ;;; hrpt_list ;;; hrpt_cnt ) (SETQ old_error *error*) (SETQ old_osmode (GETVAR "osmode")) (SETVAR "imagehlt" 1) (DEFUN *error* (msg / tempss_len tempss_cnt) (SETQ tempss_len (IF temp_ss (SSLENGTH temp_ss) 0 ) ;_ end of IF tempss_cnt 0 ) ;_ end of setq (WHILE (< tempss_cnt tempss_len) (ENTDEL (SSNAME temp_ss tempss_cnt)) (SETQ tempss_cnt (1+ tempss_cnt)) ) ;_ end of while (SETQ *error* old_error) (PRINC "\n") (PRINC msg) (PRINC "\nERROR: Hrail cancelled! ") (PRINC) ) ;_ end of defun (IF (OR (AND colri colra) colr) nil (SETQ colr "1" colri nil colra nil ) ;_ end of setq ) ;_ end of if (COND (colri (SETQ prev_colri colri)) (colr (SETQ prev_colr colr)) ) (IF c:mklayr nil (LOAD "mklayr" "\nFile MKLAYR.LSP not loaded! ") ) ;_ end of if (IF (AND ukword ureal upoint) nil (LOAD "uutils" "\nFile UUTILS.LSP not loaded! ") ) ;_ end of if (IF hrpt_end1 (SETQ end_cond1 hrpt_end1) (SETQ end_cond1 (ukword 1 "Round Point Flat Open" "First end " (IF end_cond1 end_cond1 "Round" ) ;_ end of if ) ;_ end of ukword ) ;_ end of setq ) (IF hrpt_end2 (SETQ end_cond2 hrpt_end2) (SETQ end_cond2 (ukword 1 "Round Point Flat Open" "Second end " (IF end_cond2 end_cond2 "Round" ) ;_ end of if ) ;_ end of ukword ) ;_ end of setq ) (IF hrpt_hide (SETQ do_hides hrpt_hide) (SETQ do_hides (ukword 1 "Yes No" "Create hiding blocks? " (IF do_hides do_hides "Yes"))) ) (SETVAR "PLINEWID" 0) (COND ((EQ end_cond1 "Round") (SETQ arc_end1 T pnt_end1 nil flt_end1 nil opn_end1 nil ) ;_ end of setq ) ((EQ end_cond1 "Point") (SETQ arc_end1 nil pnt_end1 T flt_end1 nil opn_end1 nil ) ;_ end of setq ) ((EQ end_cond1 "Flat") (SETQ arc_end1 nil pnt_end1 nil flt_end1 T opn_end1 nil ) ;_ end of setq ) ((EQ end_cond1 "Open") (SETQ arc_end1 nil pnt_end1 nil flt_end1 nil opn_end1 T ) ;_ end of setq ) ) (COND ((EQ end_cond2 "Round") (SETQ arc_end2 T pnt_end2 nil flt_end2 nil opn_end2 nil ) ;_ end of setq ) ((EQ end_cond2 "Point") (SETQ arc_end2 nil pnt_end2 T flt_end2 nil opn_end2 nil ) ;_ end of setq ) ((EQ end_cond2 "Flat") (SETQ arc_end2 nil pnt_end2 nil flt_end2 T opn_end2 nil ) ;_ end of setq ) ((EQ end_cond2 "Open") (SETQ arc_end2 nil pnt_end2 nil flt_end2 nil opn_end2 T ) ;_ end of setq ) ) (IF hrpt_od (SETQ rail_od hrpt_od) (SETQ rail_od (ureal 0 "" "Handrail O.D.: " (IF rail_od rail_od 1.9 ) ;_ end of if ) ;_ end of ureal ) ;_ end of setq ) (SETQ rail_hd (/ rail_od 2.0)) ;;; (SETQ hr_pnt_lst nil) (SETQ temp_ss (SSADD)) (WHILE (OR (AND hrpt_list hrpt_cnt (SETQ nxt_hr_pnt (NTH hrpt_cnt hrpt_list)) ) (AND (NOT hrpt_list) (NOT hrpt_cnt) (SETQ nxt_hr_pnt (upoint 0 "" "Pick handrail points" nil (IF nxt_hr_pnt nxt_hr_pnt ) ;_ end of if ) ;_ end of upoint ) ;_ end of setq ) ) (SETQ hr_pnt_lst (APPEND hr_pnt_lst (LIST (LIST (CAR nxt_hr_pnt) (CADR nxt_hr_pnt) (GETVAR "elevation"))))) (IF (> (LENGTH hr_pnt_lst) 1) (PROGN (IF (ENTMAKE (LIST (CONS 0 "line") ;create temporary lines so user can see points picked even after a redraw or zoom (CONS 8 "temp-hrail") (CONS 10 (CADR (REVERSE hr_pnt_lst))) (CONS 11 (CAR (REVERSE hr_pnt_lst))) ) ;_ end of LIST ) ;_ end of entmake (PROGN (SSADD (ENTLAST) temp_ss) (SETQ made_some_lines T)) ) ;_ end of IF ) ;_ end of progn ) ;_ end of if (IF hrpt_cnt (setq hrpt_cnt (1+ hrpt_cnt))) ) ;_ end of while (IF (> (LENGTH hr_pnt_lst) 1) (PROGN (IF (EQ do_hides "Yes") (PROGN (IF (TBLOBJNAME "block" "hdcirc") nil (IF (FINDFILE "hdcirc.dwg") (PROGN (COMMAND ".-insert" "hdcirc") (COMMAND)) ;define block "hdcirc" ) ;_ end of progn ) ;_ end of IF (IF (TBLOBJNAME "block" "hdbox") nil (IF (FINDFILE "hdbox.dwg") (PROGN (COMMAND ".-insert" "hdbox") (COMMAND)) ;define block "hdbox" ) ;_ end of progn ) ;_ end of IF ) ) (c:svlayr) (SETQ hrail_ss (SSADD)) (IF mjrg nil (SETQ mjrg "M") ) ;_ end of if (IF llt nil (SETQ llt "-") ) ;_ end of if (IF prod nil (SETQ prod "RAIL") ) ;_ end of if (IF colr nil (SETQ colr "1") ) (IF modf nil (SETQ modf "HAND") ) ;_ end of if (IF (WCMATCH modf "[A P S][L C][T 1 2 3 4 5 6 7 8 9 0]#") (SETQ usrd "HAND") ) (IF (AND usrd (WCMATCH usrd "[A P S][L C][T 1 2 3 4 5 6 7 8 9 0]#")) (SETQ modf "HAND") ) (c:mklayr) (SETQ hr_pnt_cnt 1) (WHILE (< hr_pnt_cnt (LENGTH hr_pnt_lst)) (SETQ hr_pnt1 (NTH (1- hr_pnt_cnt) hr_pnt_lst) ;rail segment first midpoint hr_pnt2 (NTH hr_pnt_cnt hr_pnt_lst) ;rail segment second midpoint (next rail first midpoint) hr_ang1 (+ (ANGLE hr_pnt1 hr_pnt2) (* PI 0.5)) ;perpindicular angle left hr_ang2 (+ (ANGLE hr_pnt1 hr_pnt2) (* PI 1.5)) ;perpindicular angle right hr_pntl1 (POLAR hr_pnt1 hr_ang1 rail_hd) ;left rail line first perpin. point hr_pntl2 (POLAR hr_pnt2 hr_ang1 rail_hd) ;left rail line second perpin. point hr_pntr1 (POLAR hr_pnt1 hr_ang2 rail_hd) ;right rail line first perpin. point hr_pntr2 (POLAR hr_pnt2 hr_ang2 rail_hd) ;right rail line second perpin. point ) ;_ end of setq (IF (AND hrll_nxt1 (NOT (AND (EQ hr_pnt_cnt 2) (EQ (LENGTH hr_pnt_lst) 2)))) (SETQ hrll_pnt1 hrll_nxt1 hrll_nxt1 nil ) ;_ end of setq ) ;_ end of if (IF (AND hrrl_nxt1 (NOT (AND (EQ hr_pnt_cnt 2) (EQ (LENGTH hr_pnt_lst) 2)))) (SETQ hrrl_pnt1 hrrl_nxt1 hrrl_nxt1 nil ) ;_ end of setq ) ;_ end of if (IF (< hr_pnt_cnt (1- (LENGTH hr_pnt_lst))) (PROGN (SETQ hr_nxt2 (NTH (+ hr_pnt_cnt 1) hr_pnt_lst) ;next rail segment second midpoint hr_nxang1 (+ (ANGLE hr_pnt2 hr_nxt2) (* PI 0.5)) ;next rail perpin. angle left hr_nxang2 (+ (ANGLE hr_pnt2 hr_nxt2) (* PI 1.5)) ;next rail perpin. angle right hr_nxtl1 (POLAR hr_pnt2 hr_nxang1 rail_hd) ;next left rail line first perpin. point hr_nxtl2 (POLAR hr_nxt2 hr_nxang1 rail_hd) ;next left rail line second perpin. point hr_nxtr1 (POLAR hr_pnt2 hr_nxang2 rail_hd) ;next right rail line first perpin. point hr_nxtr2 (POLAR hr_nxt2 hr_nxang2 rail_hd) ;next right rail line second perpin. point hrll_int2 (INTERS hr_pntl1 hr_pntl2 hr_nxtl1 hr_nxtl2 nil) ;left inters first/second rail hrrl_int2 (INTERS hr_pntr1 hr_pntr2 hr_nxtr1 hr_nxtr2 nil) ;right inters first/second rail ) ;_ end of SETQ (IF (> (DISTANCE hr_pntl1 hrll_int2) (DISTANCE hr_pntl1 hr_pntl2)) (SETQ hrll_pnt2 hr_pntl2 arc_endpt hr_pntl2 ) ;_ end of setq (SETQ hrll_pnt2 hrll_int2) ) ;_ end of IF (IF (> (DISTANCE hr_pntr1 hrrl_int2) (DISTANCE hr_pntr1 hr_pntr2)) (SETQ hrrl_pnt2 hr_pntr2 arc_begpt hr_pntr2 ) ;_ end of setq (SETQ hrrl_pnt2 hrrl_int2) ) ;_ end of IF (IF (> (DISTANCE hr_nxtl2 hrll_int2) (DISTANCE hr_nxtl2 hr_nxtl1)) (SETQ hrll_nxt1 hr_nxtl1 arc_begpt hr_nxtl1 ) ;_ end of setq (SETQ hrll_nxt1 hrll_int2) ) ;_ end of IF (IF (> (DISTANCE hr_nxtr2 hrrl_int2) (DISTANCE hr_nxtr2 hr_nxtr1)) (SETQ hrrl_nxt1 hr_nxtr1 arc_endpt hr_nxtr1 ) ;_ end of setq (SETQ hrrl_nxt1 hrrl_int2) ) ;_ end of IF ) ;_ end of PROGN (IF (EQ (LENGTH hr_pnt_lst) 2) (SETQ hrll_pnt2 hr_pntl2 hrrl_pnt2 hr_pntr2 arc_begpt hr_pntr2 arc_endpt hr_pntl2 ) ;_ end of SETQ ) ;_ end of IF ) ;_ end of IF (IF (AND (EQ do_hides "Yes") (OR (> hr_pnt_cnt 1) arc_end1 pnt_end1) ;place first and intermediate corner hiding blocks (TBLOBJNAME "block" "hdcirc") (ENTMAKE (LIST (CONS 0 "insert") (CONS 2 "hdcirc") (COND ((WCMATCH modf "[A P S][L C][T 1 2 3 4 5 6 7 8 9 0]#") (CONS 8 (STRCAT "A-RAIL7" modf "-HIDE"))) ((AND usrd (WCMATCH usrd "[A P S][L C][T 1 2 3 4 5 6 7 8 9 0]#")) (CONS 8 (STRCAT "A-RAIL7" usrd "-HIDE"))) (T (CONS 8 "A-RAIL7HAND-HIDE")) ) (CONS 10 (LIST (CAR hr_pnt1)(CADR hr_pnt1)(1-(CADDR hr_pnt1)))) (CONS 41 rail_od) (CONS 42 rail_od) (CONS 43 rail_od) ) ;_ end of list ) ;_ end of entmake ) ;_ end of and (SSADD (ENTLAST) hrail_ss) ) ;_ end of if (IF (AND (EQ do_hides "Yes") (EQ hr_pnt_cnt (1- (LENGTH hr_pnt_lst))) ;place last corner hiding block (OR arc_end2 pnt_end2 ) (TBLOBJNAME "block" "hdcirc") (ENTMAKE (LIST (CONS 0 "insert") (CONS 2 "hdcirc") (COND ((WCMATCH modf "[A P S][L C][T 1 2 3 4 5 6 7 8 9 0]#") (CONS 8 (STRCAT "A-RAIL7" modf "-HIDE"))) ((AND usrd (WCMATCH usrd "[A P S][L C][T 1 2 3 4 5 6 7 8 9 0]#")) (CONS 8 (STRCAT "A-RAIL7" usrd "-HIDE"))) (T (CONS 8 "A-RAIL7HAND-HIDE")) ) (CONS 10 (LIST (CAR hr_pnt2)(CADR hr_pnt2)(1-(CADDR hr_pnt2)))) (CONS 41 rail_od) (CONS 42 rail_od) (CONS 43 rail_od) ) ;_ end of list ) ;_ end of entmake ) ;_ end of and (SSADD (ENTLAST) hrail_ss) ) ;_ end of if (IF (AND (EQ do_hides "Yes") (TBLOBJNAME "block" "hdbox") ;place pipe handrail hiding blocks (ENTMAKE (LIST (CONS 0 "insert") (CONS 2 "hdbox") (COND ((WCMATCH modf "[A P S][L C][T 1 2 3 4 5 6 7 8 9 0]#") (CONS 8 (STRCAT "A-RAIL7" modf "-HIDE"))) ((AND usrd (WCMATCH usrd "[A P S][L C][T 1 2 3 4 5 6 7 8 9 0]#")) (CONS 8 (STRCAT "A-RAIL7" usrd "-HIDE"))) (T (CONS 8 "A-RAIL7HAND-HIDE")) ) (CONS 10 (POLAR (LIST(CAR hr_pnt1)(CADR hr_pnt1)(1-(CADDR hr_pnt1))) hr_ang2 rail_hd )) (CONS 41 (DISTANCE hr_pnt1 hr_pnt2)) (CONS 42 rail_od) (CONS 43 1) (CONS 50 (ANGLE hr_pnt1 hr_pnt2)) ) ;_ end of list ) ;_ end of entmake ) ;_ end of and (SSADD (ENTLAST) hrail_ss) ) ;_ end of if (COND (prev_colri (SETQ colri prev_colri colr NIL)) (prev_colr (SETQ colr prev_colr colri NIL colra NIL)) ) ;;; (COND ;;; ((WCMATCH modf "[A P S][L C][T 1 2 3 4 5 6 7 8 9 0]#") ;;; (SETQ usrd "HIDE")) ;;; ((AND usrd (WCMATCH usrd "[A P S][L C][T 1 2 3 4 5 6 7 8 9 0]#")) ;;; (SETQ modf usrd ;;; usrd "HIDE")) ;;; (T (SETQ usrd nil ;;; modf "HAND" ;;; )) ;;; ) ;;; (c:mklayr) (setq rail_layer (getvar"clayer")) (setq lay0_stat (entget(tblobjname "layer" "0"))) (if (eq (boole 1 (cdr(assoc 70 lay0_stat)) 1) 1) (progn (if (eq (boole 1 (cdr(assoc 70 lay0_stat)) 4) 4) (progn (setq lay0_stat (subst (cons 70 (-(cdr(assoc 70 lay0_stat))4))(assoc 70 lay0_stat)lay0_stat)) (princ "\n\n\t\tLocked layer 0 has been unlocked! ") (princ) ) ) (setq lay0_stat (subst (cons 70 (1-(cdr(assoc 70 lay0_stat))))(assoc 70 lay0_stat)lay0_stat)) (entmod lay0_stat) (princ "\n\t\tFrozen layer 0 has been thawed!\n\n") (princ) (setvar "clayer" "0") ) (setvar "clayer" "0") ) (COND ((AND (EQ hr_pnt_cnt 1) arc_end1) (IF (ENTMAKE (LIST (CONS 0 "arc") ; (CONS 8 "0") (CONS 10 hr_pnt1) (CONS 40 rail_hd) (CONS 50 hr_ang1) (CONS 51 hr_ang2) ) ) ;_ end of ENTMAKE (SSADD (ENTLAST) hrail_ss) )) ((AND (EQ hr_pnt_cnt 1) pnt_end1) (IF (ENTMAKE (LIST (CONS 0 "line") ; (CONS 8 "0") (CONS 10 (POLAR hr_pnt1 hr_ang1 rail_hd)) (CONS 11 (POLAR hr_pnt1 (+ hr_ang1 (* PI 0.5)) rail_hd)) ) ) ;_ end of ENTMAKE (SSADD (ENTLAST) hrail_ss) ) (IF (ENTMAKE (LIST (CONS 0 "line") ; (CONS 8 "0") (CONS 10 (POLAR hr_pnt1 (+ hr_ang1 (* PI 0.5)) rail_hd)) (CONS 11 (POLAR hr_pnt1 hr_ang2 rail_hd)) ) ) ;_ end of ENTMAKE (SSADD (ENTLAST) hrail_ss) )) ((AND (EQ hr_pnt_cnt 1) flt_end1) (IF (ENTMAKE (LIST (CONS 0 "line") ; (CONS 8 "0") (CONS 10 (POLAR hr_pnt1 hr_ang1 rail_hd)) (CONS 11 (POLAR hr_pnt1 hr_ang2 rail_hd)) ) ;_ end of LIST ) ;_ end of ENTMAKE (SSADD (ENTLAST) hrail_ss) )) ) (COND ((< hr_pnt_cnt (1- (LENGTH hr_pnt_lst))) (IF (ENTMAKE (LIST (CONS 0 "arc") ; (CONS 8 "0") (CONS 10 hr_pnt2) (CONS 40 rail_hd) (CONS 50 (ANGLE hr_pnt2 arc_begpt)) (CONS 51 (ANGLE hr_pnt2 arc_endpt)) ) ;_ end of LIST ) ;_ end of ENTMAKE (SSADD (ENTLAST) hrail_ss) )) ((AND (EQ hr_pnt_cnt (1- (LENGTH hr_pnt_lst))) arc_end2) (IF (ENTMAKE (LIST (CONS 0 "arc") ; (CONS 8 "0") (CONS 10 hr_pnt2) (CONS 40 rail_hd) (CONS 50 hr_ang2) (CONS 51 hr_ang1) ) ) ;_ end of ENTMAKE (SSADD (ENTLAST) hrail_ss) )) ((AND (EQ hr_pnt_cnt (1- (LENGTH hr_pnt_lst))) pnt_end2) (IF (ENTMAKE (LIST (CONS 0 "line") ; (CONS 8 "0") (CONS 10 (POLAR hr_pnt2 hr_ang2 rail_hd)) (CONS 11 (POLAR hr_pnt2 (+ hr_ang2 (* PI 0.5)) rail_hd)) ) ) ;_ end of ENTMAKE (SSADD (ENTLAST) hrail_ss) ) (IF (ENTMAKE (LIST (CONS 0 "line") ; (CONS 8 "0") (CONS 10 (POLAR hr_pnt2 (+ hr_ang2 (* PI 0.5)) rail_hd)) (CONS 11 (POLAR hr_pnt2 hr_ang1 rail_hd)) ) ) ;_ end of ENTMAKE (SSADD (ENTLAST) hrail_ss) )) ((AND (EQ hr_pnt_cnt (1- (LENGTH hr_pnt_lst))) flt_end2) (IF (ENTMAKE (LIST (CONS 0 "line") ; (CONS 8 "0") (CONS 10 (POLAR hr_pnt2 hr_ang1 rail_hd)) (CONS 11 (POLAR hr_pnt2 hr_ang2 rail_hd)) ) ;_ end of LIST ) ;_ end of ENTMAKE (SSADD (ENTLAST) hrail_ss) )) ) (IF (EQ hr_pnt_cnt 1) (PROGN ;set left and right pnt1 and pnt2 for first rail (SETQ hrll_pnt1 (POLAR hr_pnt1 hr_ang1 rail_hd) hrrl_pnt1 (POLAR hr_pnt1 hr_ang2 rail_hd) ) ;_ end of setq ) ;_ end of progn ) ;_ end of if ;;; (IF ;;; (and (not (eq hr_pnt_cnt 1))(not (EQ hr_pnt_cnt (1- (LENGTH hr_pnt_lst))))) ;;; (progn ;set left and right pnt1 and pnt2 for intermediate rails ;;; ) ;;; ) (IF (AND (NOT (EQ hr_pnt_cnt 1)) (EQ hr_pnt_cnt (1- (LENGTH hr_pnt_lst)))) (PROGN ;set left and right pnt1 and pnt2 for last rail (SETQ hrll_pnt2 (POLAR hr_pnt2 hr_ang1 rail_hd) hrrl_pnt2 (POLAR hr_pnt2 hr_ang2 rail_hd) ) ;_ end of setq ) ;_ end of progn ) ;_ end of IF (IF (ENTMAKE (LIST (CONS 0 "line") ;create left line ; (CONS 8 "0") (CONS 10 hrll_pnt1) (CONS 11 hrll_pnt2) ) ;_ end of list ) ;_ end of entmake (SSADD (ENTLAST) hrail_ss) ) ;_ end of if ;;; (IF debugpts ;;; (PROGN ;;; (pttxt "HRAIL_" "hrll_pnt" 1 3) ;;; ) ;;; ) (IF (ENTMAKE (LIST (CONS 0 "line") ;create right line ; (CONS 8 "0") (CONS 10 hrrl_pnt1) (CONS 11 hrrl_pnt2) ) ;_ end of list ) ;_ end of entmake (SSADD (ENTLAST) hrail_ss) ) ;_ end of if ;;; (IF debugpts ;;; (PROGN ;;; (pttxt "HRAIL_" "hrrl_pnt" 1 3) ;;; ) ;;; ) (SETQ hr_pnt_cnt (1+ hr_pnt_cnt)) ) ;_ end of while ;;; (IF (EQ (CONS 10 hrrl_pnt1)(ASSOC 10(ENTGET(SSNAME hrail_ss (1-(SSLENGTH hrail_ss)))))) (PROGN (COMMAND ".pedit" (ENTLAST) "Y" "J" hrail_ss "" "") (SSADD (ENTLAST) hrail_ss) (setq hrail_sslen (sslength hrail_ss) hrail_sscnt 0 remain_ss (SSADD) ) (while (< hrail_sscnt hrail_sslen) (IF (SETQ found_it (entget (ssname hrail_ss hrail_sscnt))) (IF (OR (EQ (CDR (ASSOC 0 found_it)) "LINE") (EQ (CDR (ASSOC 0 found_it)) "ARC")) (PROGN (SETQ remain_ename (CDR (ASSOC -1 found_it))) (SSADD remain_ename remain_ss) ) ) ) (SETQ hrail_sscnt (1+ hrail_sscnt)) ) (IF (and remain_ss (>(sslength remain_ss)0)) (PROGN (COMMAND ".pedit" remain_ename "Y" "J" remain_ss "" "") (SSADD (ENTLAST) hrail_ss) ) ) (SETQ hr_cdate (GETVAR "cdate") grp_name1 (RTOS (FIX hr_cdate) 2 0) grp_name2 (RTOS (FIX (* 1000000 (REM hr_cdate (FIX hr_cdate)))) 2 0) grp_name (STRCAT "HRAIL_" grp_name1 grp_name2) grp_desc (STRCAT (RTOS rail_od 2 2) "\" Hand rail") ) ;_ end of SETQ (COMMAND "-group" "create" grp_name grp_desc hrail_ss "") (SETVAR "osmode" 0) (IF (EQ do_hides "Yes") (PROGN (setvar "clayer" rail_layer) (COMMAND ".-block" grp_name (CAR hr_pnt_lst) hrail_ss "") (COMMAND ".-insert" grp_name (CAR hr_pnt_lst) 1 1 0) (SETQ last_hrail (ssadd)) (SSADD (ENTLAST) last_hrail) ) ) (SETVAR "osmode" old_osmode) ) ;_ end of PROGN ;;; (PROGN ;;; (PRINC) ;;; ) ;;; ) ) ;_ end of PROGN ) ;_ end of IF (IF (AND made_some_lines temp_ss) (PROGN (SETQ tempss_len (SSLENGTH temp_ss) tempss_cnt 0 ) ;_ end of setq (WHILE (< tempss_cnt tempss_len) (ENTDEL (SSNAME temp_ss tempss_cnt)) (SETQ tempss_cnt (1+ tempss_cnt)) ) ;_ end of while ) ;_ end of progn ) ;_ end of IF (c:rslayr) (c:hrupd) (IF (FINDFILE "1x1.bmp") (PROGN (IF (TBLOBJNAME "block" "hdcirc") nil (PROGN (PRINC "\nDrawing HDCIRC.DWG not found! Hiding corners disabled. ") (PRINC)) ) ;_ end of IF (IF (TBLOBJNAME "block" "hdbox") nil (PROGN (PRINC "\nDrawing HDBOX.DWG not found! Hiding handrail disabled. ") (PRINC)) ) ;_ end of IF ) ;_ end of PROGN (PROGN (PRINC "\nImage 1X1.BMP not found! Hiding handrail disabled. ") (PRINC)) ) ;_ end of IF (SETQ *error* old_error) (PRINC) ) ;defun (DEFUN c:hrupd ( / handrail_ss) (SETQ oldcmdecho (GETVAR "cmdecho")) (SETVAR "cmdecho" 0) (SETQ handrail_ss (SSGET "x" '((2 . "HRAIL_*")))) ;;; (SETQ hdcirc_ss (SSGET "x" '((8 . "*RAIL?HAND-HIDE")))) ;;; (SETQ hrails_ss (SSGET "X" '((8 . "*RAIL?HAND")))) (IF handrail_ss;(AND hrails_ss hdcirc_ss) (PROGN (COMMAND "imageframe" "off") ;;; (COMMAND "_.draworder" hdcirc_ss "" "f") ;;; (COMMAND "_.draworder" hrails_ss "" "f") ;;; (COMMAND "_.move" hdcirc_ss "" "0,0" "") (COMMAND "_.move" handrail_ss "" "0,0" "") (IF last_hrail (PROGN (COMMAND "_.draworder" last_hrail "" "f") (COMMAND "_.move" last_hrail "" "0,0" "") (SETQ last_hrail nil) ) ) ) ;_ end of PROGN (PROGN (PRINC "\nNo handrail objects found! ") (PRINC)) ) ;_ end of IF (SETVAR "cmdecho" oldcmdecho) (PRINC) (PRINC) ) ;_ end of defun ;;;Setq debugpts T to enable placement of text at the points "bxp#" ;;; (IF debugpts ;;; (IF pttxt ;;; nil ;;; (LOAD "pttxt" "\nFile PTXT.LSP not loaded!") ;;; ) ;_ end of IF ;;; ) ;_ end of if ;;; (IF (AND debugpts pttxt) ;;; (PROGN (IF fthk ;;; nil ;;; (SETQ fthk 5.0) ;;; ) ;_ end of IF ;;; (pttxt "HDBOX_" "bxp" 1 5) ;;; ) ;_ end of PROGN ;;; ) ;_ end of if ;;;Use the above to graphically identify and debug the defined points. ;|«Visual LISP© Format Options» (120 2 15 2 T "end of " 100 9 2 0 nil nil nil T T) ;*** DO NOT add text below the comment! ***|;