;; given a list of raw dic entries this proced
;; will report entity names
nil
(defun strParse
(aStr delim
/ strList pos
) ;; Find the postition where the delimiter first shows up.
;; create a list of the fist substring (up untill the delimiter)
;; Skip over the delimiter and grab the rest of the string,
;; Set that as the new string
)
)
(defun process
-on
-drawing
( process
) ;; a simple `hook' to run a process
;; (if (= (getvar 'DWGTITLED) 1)
;; "Drawing not saved"
;; )
)
(defun get
-list
-from
-file
( name
/ fp lst read
-file
-into
-list ) ;; general file reader
;; given a file name this procedure will read the contents
;; into a list
str)
lst
)
(defun files
-p
( path pattern
) ;; files-p
;;
;; Returns a list of all the files in a given path
;; with a given search pattern. If a nill pattern
;; to search for is not given, defaults to ``*.*''.
;;
;; Ex:
;; (files-p "C:\\" nil)
;;
;; => returns all files in directory specified.
;;
;; By: John (7) K
;;
(
nil
path ; a
pattern ; e
) )
(defun get
-drawing
-dictionary
-list ( what
/ x lst
) ;; retrieve a list of drawing dictionary entries
(defun remove
-uncomon
-names
( ls
) ;; return the items that are not in drawing lt list
(= x "")
x))
ls) )
ltype-file-locations
ltype-locations
(process
-on
-drawing '
(get
-drawing
-dictionary
-list "LTYPE"))) ;; build a list of litetype names loaded in dwg
ltype-file-locations
;; itterate thru the entire search path to look for .lin files
(setq tmp
-str
(files
-p x
"*.lin")) x
"\\"
(strparse
(getvar "ACADPREFIX") ";") )) ltype-locations
;; a list of lists for the linetypes and their locations
;; ( <path>+<file> ( <ltype> <ltype> ... ))
(get-list-from-file x)
)
)
)
ltype-file-locations
)
)
;; Clean the list of lists for the linetypes and their locations by removing duplicates
;; already loaded in drawing.
;; ( <path>+<file> ( <ltype> <ltype> ... ))
)
(if x
(command
-s
"_.linetype" "_load" x
(car todo
-list) "")) )
)
)
(C:LoadLTs)