输出全局变量及函数名至csv文件
;输出函数名及全局变量
(defun c:tt1 (/ nn l fn)
(setq nn (open "c:\\函数.csv" "w"))
(setq l (mapcar 'eval (atoms-family 0)))
(if (setq fn (getfiled "" "" "*" 4))
(progn
(load fn)
(setq a
(mapcar
(vl-remove-if
'(lambda (x) (= "" (substr x 1 2)))
(mapcar
'VL-PRINC-TO-STRING
(vl-remove-if
'(lambda (x) (member (eval x) l))
(atoms-family 0)
)
)
)
)
)
(if a
(progn
(setq b (vl-remove-if'(lambda (x) (= (type (eval (read x))) 'SUBR)) a))
(foreach n a (write-line n nn))
(if b
(progn
(write-line "全局变量为"nn)
(foreach n b (write-line n nn))
)
)
(close nn)
)
)
)
)
(ALERT "文件保存至c:\\函数.csv")
(princ)
)
页:
[1]