明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2214|回复: 6

如何使用vlisp将目录加入CAD支持路径中

[复制链接]
发表于 2005-4-18 22:20:00 | 显示全部楼层 |阅读模式
请教各位:使用vlisp如何判断某目录存在,并设置其为CAD支持目录?
发表于 2005-4-18 22:51:00 | 显示全部楼层
这个我也不会,也需要
发表于 2005-4-19 08:36:00 | 显示全部楼层
发表于 2005-4-19 08:37:00 | 显示全部楼层
我觉得写注册表的方法也不错吧~
发表于 2005-4-19 09:48:00 | 显示全部楼层
CADghost发表于2005-4-19 8:37:00我觉得写注册表的方法也不错吧~

给点例子看看吧。
发表于 2008-11-5 10:45:00 | 显示全部楼层

;;lyy 支持appload加载、命令行(load "xx")加载和直接拖曳加载

(vl-load-com)
(defun set_path (/ str n1 n2)
(while (/= 0 (getvar "cmdactive")) (command))
(princ "\n")
(setq str (getvar "lastprompt"))
(if (wcmatch (strcase str) "*(LOAD \"*")
    (setq n1 (vl-string-search "(LOAD \"" str)
          n2 (vl-string-search "\")" str)
          str (substr str (+ n1 8) (- n2 n1 7))
    )
    (setq str
      (vl-registry-read "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSaveMRU\\*"
        (substr (vl-registry-read "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSaveMRU\\*" "MRUList") 1 1)
      )
    )
)
(setenv "ACAD" (strcat (getenv "ACAD") ";" (vl-filename-directory str)))
)
(set_path)
(setq set_path nil)
(princ)
转自

发表于 2020-9-29 22:48:02 | 显示全部楼层
hagoodyear 发表于 2008-11-5 10:45
;;lyy 支持appload加载、命令行(load "xx")加载和直接拖曳加载(vl-load-com)(defun set_path (/ str n1 n2) ...

appload加载不行。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-17 17:25 , Processed in 0.173241 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表