;;; MC-LOAD.LSP
;;; Copyright (C) 1997 - 2002 by 明经通道 http://www.mjtd.com
;; 以下为加载明经制图辅助工具
(defun add_path ( dir / a b c)
(if (and dir
(setq c (getenv "ACAD"))
);and
(progn
;看看DIR目录是否在AutoCAD的支持目录中
(setq a (strcase c)
b (strcase dir)
);setq
(if (not (equal ";" (substr a 1 1)))
(setq a (strcat ";" a)) ;在 a 前面加上一个";"
);if
(if (not (equal ";" (substr a (strlen a) 1)))
(setq a (strcat a ";")
c (strcat c ";") ;在后面加上一个";"
);setq
);if
(if (not (wcmatch a (strcat "*;" b ";*"))) ;查看“DIR”是否在支持路径中?
(progn
(setq c (strcat c dir));没有时则添加
(setenv "ACAD" c) ;设置到支持路径的环境变量中
);progn
(setq c nil)
);if
);progn then
(setq c nil)
);if
c
);defun add_path