<p>可以提供注册机,请跟我联系!</p><p>Email:<a href="mailto:linyy@126.com">linyy@126.com</a></p> <p>这个问题一直没人解决!我有个DVB文件,要让他随着CAD一起启动,我在某个自动加载的LSP文件中,写下</p><p>(command "vbaload" "scei.dvb")<br/>(command "-vbarun" "scei.dvb!acadstartup")</p><p>这个宏能够加载,问题是,当使用你的打印工具时,打开第一个DWG文件时,完全没有问题,当打开第二个DWG文件是,系统就跳出提示:</p><p>“已经加载D:\SCEI.DVB”,也就是说可能是重复加载了,</p><p>如何能让这个DVB文件只在首次打开CAD时加载,也就是说在LSP中要添加什么内容,能使他判断是否为首次打开,如果是,加载,否则不加载!</p> aicr317发表于2008-7-20 10:03:00static/image/common/back.gif这个问题一直没人解决!我有个DVB文件,要让他随着CAD一起启动,我在某个自动加载的LSP文件中,写下(command \"vbaload\" \"scei.dvb\")(command \"-vbarun\" \"scei.dvb!acadstartup\")这个宏
<p>加载语句不要写入acaddoc.lsp文件,请使用acad.lsp文件,并设置acadlspasdoc=0!</p> <p>我使用的是秋风的二次开发安装程序,其中</p><p>;;; 判断是否加载本文件<br/>(if (car (atoms-family 1 '("vl-load-com")))<br/> (vl-load-com)<br/> ;;else<br/> (progn<br/> (Alert<br/> "这个程序集是为AutoCAD 2000以及更高的版本设计的,许多程序有可能在没有Visual Lisp for R14支持的AutoCAD R14上不能正确地运行。"<br/> )<br/> (exit) ; 版本不符,退出加载。<br/> )<br/>)</p><p>;;; 以下定义文件中用到的函数<br/>;;;----------------------------------------------------------------------------------</p><p>;;; 取得本程序的路径<br/>;;; ---------------------------------------------------------------------------------<br/>(defun GetMyApplicationPath (AppID)<br/> (vl-registry-read<br/> (strcat<br/> "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"<br/> AppID<br/> "_is1"<br/> )<br/> "Inno Setup: App Path"<br/> )<br/>)</p><p>(defun GetsceiPath ()<br/> (GetMyApplicationPath "1")<br/>)</p><p>;;; 解析字符串为表(函数来自明经通道转载)<br/>;;; ---------------------------------------------------------------------------------<br/>(defun strParse (Str Delimiter / SearchStr StringLen return n char)<br/> (setq SearchStr Str)<br/> (setq StringLen (strlen SearchStr))<br/> (setq return '())<br/> (while (> StringLen 0)<br/> (setq n 1)<br/> (setq char (substr SearchStr 1 1))<br/> (while (and (/= char Delimiter) (/= char ""))<br/> (setq n (1+ n))<br/> (setq char (substr SearchStr n 1))<br/> ) ;_ end of while<br/> (setq return (cons (substr SearchStr 1 (1- n)) return))<br/> (setq SearchStr (substr SearchStr (1+ n) StringLen))<br/> (setq StringLen (strlen SearchStr))<br/> ) ;_ end of while<br/> (reverse return)<br/>) ;_ end of defun</p><p>;;; 反解析表为字符串(函数来自明经通道转载)<br/>;;; ---------------------------------------------------------------------------------<br/>(defun StrUnParse (Lst Delimiter / return)<br/> (setq return "")<br/> (foreach str Lst<br/> (setq return (strcat return Delimiter str))<br/> ) ;_ end of foreach<br/> (substr return 2)<br/>) ;_ end of defun</p><p>;;; 移除支持文件搜索路径<br/>;;; ---------------------------------------------------------------------------------<br/>(defun RemoveSupportPath (PathToRemove / supportlist)<br/> (setq supportlist (strparse (getenv "ACAD") ";"))<br/> (setq supportlist (vl-remove "" supportlist))<br/> (setq supportlist<br/> (vl-remove-if<br/> '(lambda (x) (= (strcase x) (strcase PathToRemove)))<br/> supportlist<br/> )<br/> )<br/> (setenv "ACAD" (strUnParse supportlist ";"))<br/>)</p><p>;;; 添加支持文件搜索路径<br/>;;; ---------------------------------------------------------------------------------<br/>;;; note: 第二个参数如果为真, 插最前,否则插最后<br/>;;; <br/>(defun AddSupportPath (PathToAdd isFirst / supportlist)<br/> (RemoveSupportPath PathToAdd)<br/> (setq supportlist (strparse (getenv "ACAD") ";"))<br/> (setq supportlist (vl-remove "" supportlist))<br/> (if isFirst<br/> (setq supportlist (cons PathToAdd supportlist))<br/> (setq supportlist (append supportlist (list PathToAdd)))<br/> )<br/> (setenv "ACAD" (strUnParse supportlist ";"))<br/>)</p><p>;;; 根据不同的AutoCAD版本加载不同的菜单文件:<br/>(defun Load_sceiMenu (/ acadver)<br/> (setq acadver (atof (getvar "acadver")))<br/> (cond<br/> ((and (>= acadver 15.0) (< acadver 16.0))<br/> (command "_menuload" "scei.mnu")<br/> )<br/> ((and (>= acadver 16.0) (<= acadver 16.1))<br/> (command "_menuload" "scei.mnu")<br/> )<br/> ((>= acadver 16.2) (command "_menuload" "scei.cui"))<br/> )<br/>)</p><p>;;; The following code "placemenu" written by LUCAS<br/>;;; 插入菜单条 Placemenu由LUCAS编写<br/>;;; ---------------------------------------------------------------------------------<br/>(defun scei_PlaceMenu (/ n)<br/> (if (menugroup "gj")<br/> (progn<br/> (setq n 1)<br/> (while (< n 24)<br/> (if (menucmd (strcat "P" (itoa n) ".1=?"))<br/> (setq n (+ n 1))<br/> (progn<br/> ;(if (> n 3)<br/> ;(setq n (- n 2))<br/> ;(setq n 3)<br/> ;) ;if<br/> (menucmd (strcat "p" (itoa n) "=+gj.pop3"))<br/> (menucmd (strcat "p" (itoa n) "=+gj.pop2"))<br/> (menucmd (strcat "p" (itoa n) "=+gj.pop1"))<br/> (setq n 25)<br/> ) ;progn<br/> ) ;if<br/> ) ;while<br/> ) ;progn<br/> ) ;if<br/> (princ)<br/>)</p><p>;;; 初始化主函数<br/>;;; ---------------------------------------------------<br/>(defun Init_scei ()<br/> ;; 添加支持路径 <br/> (AddSupportPath (GetsceiPath) nil)<br/> (AddSupportPath (strcat (GetsceiPath) "\\阀门") nil)<br/> (AddSupportPath (strcat (GetsceiPath) "\\计算工具") nil)<br/> (AddSupportPath (strcat (GetsceiPath) "\\图签") nil)<br/> (AddSupportPath (strcat (GetsceiPath) "\\文档") nil)<br/> (AddSupportPath (strcat (GetsceiPath) "\\其他软件") nil)</p><p><br/> ;; 如果菜单组还没有被加载,则加载之<br/> (if (not (menugroup "gj"))<br/> (Load_sceiMenu)<br/> )</p><p> ;; 安排菜单条的位置<br/> (scei_PlaceMenu)</p><p> (princ)<br/>)<br/>;;; 以上函数部分定义完毕</p><p>;;; -----------------------------------------------------<br/>;;; 主程序:<br/>;;; -----------------------------------------------------<br/>;(princ "\n加载scei工具集……")</p><p>(setq scei_cmdecho_save (getvar "cmdecho"))<br/>(setvar "cmdecho" 0)</p><p>;;; 执行初始化<br/>(Init_scei)</p><p>(setvar "cmdecho" scei_cmdecho_save)<br/>(setq scei_cmdecho_save nil)</p><p>(princ "\n")<br/>(princ)</p><p></p><p>;; 加载主程序<br/>(arxload "scei.arx")<br/>(command "vbaload" "scei.dvb")<br/>(command "-vbarun" "scei.dvb!acadstartup")<br/>(load "scei.lsp")<br/>(load "bplot.vlx")<br/>(load "y5.vlx")</p><p>(princ)</p><p></p><p></p><p>请问该怎么修改!谢谢!</p> aicr317发表于2008-7-20 11:40:00static/image/common/back.gif我使用的是秋风的二次开发安装程序,其中;;; 判断是否加载本文件(if (car (atoms-family 1 '(\"vl-load-com\"))) (vl-load-com) ;;else (progn (Alert&nb
<p>删除(command "vbaload" "scei.dvb")和(command "-vbarun" "scei.dvb!acadstartup")语句,使用acad.lsp加载!</p> <p>使用ACAD.LSP加载的话,我怎么能让他在安装我的工具时,把它自动写进ACAD.LSP中呢!</p> aicr317发表于2008-7-20 11:48:00static/image/common/back.gif使用ACAD.LSP加载的话,我怎么能让他在安装我的工具时,把它自动写进ACAD.LSP中呢!
<p>这个要去问秋风了!</p> aicr317发表于2008-7-20 10:03:00static/image/common/back.gif这个问题一直没人解决!我有个DVB文件,要让他随着CAD一起启动,我在某个自动加载的LSP文件中,写下(command \"vbaload\" \"scei.dvb\")(command \"-vbarun\" \"scei.dvb!acadstartup\")这个宏
你没有使用YAD打印时,打开第二个DWG系统会跳出提示吗?