(defun process
-on
-drawing
( process
) ;; a simple `hook' to run a process on a saved drawing only
"Drawing not saved") )
(defun get
-value
( val lst
) ;; shortcut for returning value in assoc list
;; given a list of raw dic entries this proced
;; will report entity names
nil
(defun get
-drawing
-dictionary
-list ( what
/ x lst
) ;; retrieve a list of drawing dictionary entries
(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 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
;; get string from file; if it is a comment, return an empty string.
lst
)
;; remake the drawing ltype list
(process-on-drawing
'
(get
-drawing
-dictionary
-list "LTYPE")))) );_ end progn
);_ end if
)
;;; setup...
ltype-file-locations
;; itterate thru the entire search path to look for .lin files
x
"\\"
(strparse
(getvar "ACADPREFIX") ";") )) ltype-locations
;; a list of lists for the lietypes and their locations
;; ( <path>+<file> ( <ltype> <ltype> ... ))
(get-list-from-file x)
)
)
)
ltype-file-locations
)
)
;;; more setup...(creating lists).
;; create the layers
;; do not opperate on null entries.
lt
;; itterate thru the ltype file list to see which
;; file contains the missing linetype, then load it
'lt-find
ltype-locations )
;; another search level incase we still coulnt find lt.
"\nLinetype for Layer: "
(get-value 2 x)
" Not found, using continuous instead."))
)
);_ end if
)
);_ end cond
plot
((get-value 290 x)
(cons 290 (get
-value
290 x
))) (t
(cons 290 1))));_ end setq '(0 . "LAYER")
'(100 . "AcDbSymbolTableRecord")
'(100 . "AcDbLayerTableRecord")
(cons 70 (get
-value
70 x
)) (cons 62 (get
-value
62 x
)) plot
lt
);_ end list
);_ end entmake
)
)
)
)