;;;Customized version of CDMNDX just for Las Vegas CDM. ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 4-22-97 ;;;> EDITED: 05-17-2001 ;;; (defun lvndx ( / attlst ttl1ss iniblk inient nxtent dwg_# sht_# dsgnd drwn chkd dscale sub_by desdir;| ttl11 ttl13 ttl33 ttl14 ttl12 ttl22 ttl44 |;ndx_df rd_lin wf_lst datlst ttllst) (if (and (setq ttl1ss (ssget "x" '((-4 . "")) ) ) (setq ttl2ss (ssget "x" '((-4 . "") (-4 . "and>")) ) )) (progn (if (>(sslength ttl1ss)1) (princ "\nMore than one block HUATTSAT is in the drawing. ") (progn (setq iniblk (ssname ttl1ss 0)) (setq inient (entget iniblk)) (setq attlst nil) (setq nxtent (entget(entnext iniblk))) (while (/=(cdr(assoc 0 nxtent))"SEQEND") (if (eq(cdr(assoc 0 nxtent))"ATTRIB") (if attlst (setq attlst (append attlst (list(assoc 2 nxtent)(assoc 1 nxtent)) ) ) (setq attlst (list(assoc 2 nxtent)(assoc 1 nxtent))) ) ) (setq nxtent (entget(entnext(cdar nxtent)))) );while (if attlst (progn (if (member (cons 2 "NO.") attlst) (setq sht_# (cdadr(member(cons 2 "NO.")attlst)) dwg_# (cdr(cadddr(member(cons 2 "NO.")attlst)))) (setq sht_# "" dwg_# "") ) (if (=(strlen sht_#)1) (setq sht_# (strcat "0" sht_#)) ) ) ) ) ) (if (>(sslength ttl2ss)1) (princ "\nMore than one block (#)LT is in the drawing. ") (progn (setq iniblk (ssname ttl2ss 0)) (setq inient (entget iniblk)) (setq at2lst nil) (setq nxtent (entget(entnext iniblk))) (while (/=(cdr(assoc 0 nxtent))"SEQEND") (if (eq(cdr(assoc 0 nxtent))"ATTRIB") (if at2lst (setq at2lst (append at2lst (list(assoc 2 nxtent)(assoc 1 nxtent)) ) ) (setq at2lst (list(assoc 2 nxtent)(assoc 1 nxtent))) ) ) (setq nxtent (entget(entnext(cdar nxtent)))) );while (if at2lst (progn (if (member (cons 2 "1ST-LINE-TITLE") at2lst) (setq ttl_1 (cdadr(member(cons 2 "1ST-LINE-TITLE")at2lst))) (setq ttl_1 "") ) (if (member (cons 2 "2ND-LINE-TITLE") at2lst) (setq ttl_2 (cdadr(member(cons 2 "2ND-LINE-TITLE")at2lst))) (setq ttl_2 "") ) (if (member (cons 2 "3RD-LINE-TITLE") at2lst) (setq ttl_3 (cdadr(member(cons 2 "3RD-LINE-TITLE")at2lst))) (setq ttl_3 "") ) (if (and ttl_1 (>(strlen ttl_1)0)) (if (and ttl_2 (>(strlen ttl_2)0)) (if (and ttl_3 (>(strlen ttl_3)0)) (setq ttl (strcat sht_# "\\" dwg_# "\\" ttl_1 " " ttl_2 " " ttl_3)) (setq ttl (strcat sht_# "\\" dwg_# "\\" ttl_1 " " ttl_2)) ) (setq ttl (strcat sht_# "\\" dwg_# "\\" ttl_1)) ) ) ) ) ) ) (if ttl (if (findfile "lvvwd.ndx") (progn (setq nxfile (open "lvvwd.ndx" "r") nxlist nil) (while (setq nxrdln (read-line nxfile)) (if nxlist (setq nxlist (append nxlist (list nxrdln))) (setq nxlist (list nxrdln)) ) ) (setq xnxlst nxlist) (close nxfile) (foreach n nxlist (if (eq (substr ttl 1 3)(substr n 1 3)) (setq nxlist (subst ttl n nxlist)) ) ) (if (>(length nxlist)1) (setq nxlist (acad_strlsort nxlist)) ) (if (eq xnxlst nxlist) nil (progn (setq nxfile (open "lvvwd.ndx" "w")) (foreach n nxlist (write-line n nxfile) ) (close nxfile) ) ) ) (progn (setq nxfile (open "lvvwd.ndx" "w")) (write-line ttl nxfile) (close nxfile) ) ) ) ) ) ; (foreach n wf_lst ; (if (eq(type n)'STR) ; (if srtlst ; (setq srtlst (append srtlst (list n))) ; (setq srtlst (list n)) ; ) ; ) ; ) ; (setq srtlst (acad_strlsort srtlst)) (princ) )