[原创]open的LSP程序
<p>(defun c:ww()<br/>(vl-load-com)<br/>(setq kk (getfiled "Select File" (strcat(vla-get-path (vla-get-activedocument (vlax-get-acad-object)))) "dwg" 16))<br/>(sopen kk) <br/> )</p><p>(defun openRO (fna)<br/> (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) fna :VLAX-TRUE))<br/>)</p><p>(defun sopen (fna / n)<br/> (if (= 0 (getvar "SDI"))<br/> (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) fna))<br/> (progn<br/> (if (not (equal 2 (logand 2 (getvar "qaflags")))) <br/> (setvar "qaflags" (+ (getvar "qaflags") 2))<br/> )<br/> (if (not (equal 4 (logand 4 (getvar "qaflags")))) <br/> (setvar "qaflags" (+ (getvar "qaflags") 4))<br/> )<br/> (command "_.open")<br/> (if (not (equal 0 (getvar "dbmod")))<br/> (command "_y")<br/> )<br/> (command fna) <br/> (setq n 0)<br/> (while (and (< n 4)<br/> (wcmatch (getvar "cmdnames") "*OPEN*")<br/> )<br/> (T<br/> (command "")<br/> )<br/> (setq n (+ n 1))<br/> )<br/> (setvar "qaflags" 0)<br/> )<br/> )<br/>)</p><p><br/></p> <p>(setq kk (getfiled "Select File" (strcat(vla-get-path (vla-get-activedocument (vlax-get-acad-object)))) "dwg" 16))<br/>改成(setq kk (getfiled "Select File" (strcat(vla-get-path (vla-get-activedocument (vlax-get-acad-object)))) "dwg;dws;dxf;dwt" 16))</p><p>就和CAD本身的open开启的选项一样了!<br/></p> <p>直接用“open”命令不可以吗,</p> <p>能不能做个“只读”打开文件的功能 ?!</p> LZ,能不能做个新建(QNEW)命令的LISP程序?好像QNEW命令和OPEN命令一样不能直接调用的,学习学习VLA的用法。 可以应用到程序中,谢谢啦 总结的好{:1_1:}
页:
[1]