将如下这段代码添加到你程序的任何地方,即可实现自动判断加载天正插件!
- ;;自动判断加载天正
- (if (and
- (member "TCH_DBCONFIG"
- (mapcar 'cdr
- (vl-remove-if
- '(lambda (a) (/= 3 (car a)))
- (entget (namedobjdict))
- )
- )
- )
- (not
- (member (strcase "tch_kernal.arx") (mapcar 'strcase (arx)))
- )
- (findfile "tch_kernal.arx")
- (arxload "tch_kernal.arx" "\n未找到天正插件!")
- )
- (princ "\n天正插件已自动加载...")
- )
注意:天正插件arx必须在可搜索目录里,否则"tch_kernal.arx"请自行添加绝对目录! |