; 16-Dec-08 NEHolt created (defun c:lib_sysvar_list ( / sysvar_lst x path str ff val dlst dnam sysvar fout) (setq sysvar_lst nil) (setq x GBL_WD_BASELIBS) ; point at AutoCAD Electrical base symbol library (if (not x)(setq x "")) ; Allow user to browse to target library folder (setq path (c:wd_pview_folder "Select symbol lib folder to process" x)) ; Make sure all slashes are "back slashes" (if path (setq path (wd_4_all_slashes_backward (strcase path T)))) (if (AND path (/= path "")) ; user select some folder & no "Cancel" (progn ; get list of all ".dwg" files in this folder (if (not (setq dlst (wd_1a_dir_filelist path "*.dwg" nil 1))) (princ "\nNo files found in this folder.") ; ELSE (progn ; okay to continue (princ "\nFile count:")(princ (length dlst))(princ "\n") (princ (strcat "Enter SYSTEM VARIABLES to extract. " "Enter \";\" delimited, no spaces.\n")) (setq str (getstring "Sysvars:" T)) (if (AND str (/= str "")) (setq sysvar_lst (c:wd_delim_str_to_lst str ";")) ) (if sysvar_lst (progn ; okay to continue ; Open a text file to save results (setq fout (open "c:/sysvar.rep" "w")) (write-line path fout) ; output the "path" to the report file (foreach dnam dlst ; Process each drawing (princ "\n") ; Open dwg file using AutoCAD Electrical special function (setq ff (wd_dbx_open dnam "r")) (if ff (progn (foreach sysvar sysvar_lst ; Read the target system variable name (setq val (wd_dbx_getvar ff sysvar)) (princ sysvar)(princ "=")(princ val)(princ " ") ; push out to the output file (princ sysvar fout) (princ "=" fout) (princ val fout) (princ " " fout) ) ; Attach drawing name to end of each line of display (princ " Dwg=")(princ (cadr (c:wd_split_fnam dnam))) ; put out to the output file (princ " Dwg=" fout) (princ (cadr (c:wd_split_fnam dnam)) fout) (princ "\n" fout) (wd_dbx_close ff) (setq ff nil) ) ) ) ) ) ) ) ) ) (if fout (progn (close fout) ; close the report file (setq fout nil) (princ "\nReport file= c:\\sysvar.rep") ) ) (princ) )