已知此程序包含院长内库,给出此程序,求推导出这个内库的替代函数,不知哪位大神可以
已知此程序包含院长内库,给出此程序,求推导出这个内库的替代函数,不知哪位大神可以补充一个替代函数此程序为小韩所写,求各位大神补充一个替代函数替代这个(xyp-Shell-Open (strcat ml "\\" (nth i lst3)) nil)
;; =============================================
;; | 打开文件夹内所有图纸 |
;; =============================================
(defun c:DKTZ (/ a1 cd fn i lst2 lst3 n qz)
(or ml (setq ml ""))
(setq
fn (GetFiled "选择dwg文件" ml "dwg" 16)
qz (substr (VL-FILENAME-BASE fn) 1 1)
cd (strlen qz)
ml (vl-filename-directory fn)
lst2 (vl-directory-files ml "*.dwg");列出文件夹内文件
lst3 '()
n 0
)
(while (< n (length lst2))
(setq a1 (substr (nth n lst2) 1 cd))
(if (= a1 qz)
(setq lst3 (cons (nth n lst2) lst3))
)
(setq n (1+ n))
)
(setq i 0)
(repeat (length lst3)
(xyp-Shell-Open (strcat ml "\\" (nth i lst3)) nil)
(setq i (1+ i))
)
(princ)
)
跟open打开有区别吗 south 发表于 2024-6-8 17:01
跟open打开有区别吗
应该有区别吧 估计是arx写的吧 让院长分享 (defun myopenpath (filepath )
(or *winshell
(setq *winshell (vlax-create-object "Shell.Application" ))
)
(vlax-invoke-method *winshell 'Open filepath)
)
;; =============================================
;; | 打开文件夹内所有图纸 |
;; =============================================
(defun c:DKTZ (/ fn ml lst2 file)
(or ml (setq ml ""))
(setq
fn (GetFiled "选择dwg文件" ml "dwg" 16)
ml (vl-filename-directory fn)
lst2 (vl-directory-files ml "*.dwg");列出文件夹内文件
)
(foreach file lst2
(myopenpath (strcat ml "\\" file))
)
(princ)
)
这样不行吗
本帖最后由 alexmai 于 2024-6-10 20:46 编辑
jun353835273 发表于 2024-6-8 22:26
2010 不能用 (defun hx:Opendwg (FilePath Activate / oFile)
(vl-load-com)
(if(findfile FilePath)
(if
(vl-catch-all-error-p
(setq oFile(vl-catch-all-apply 'vla-open (list(vla-get-Documents(vlax-get-acad-object)) FilePath)))
)
(alert (strcat "错误!\n 无法打开文件: " FilePath))
(if Activate (vla-Activate oFile))
)
(alert(strcat "错误!\n 找不到文件: " FilePath))
); end if
oFile
) jun353835273 发表于 2024-6-8 22:26
谢谢大哥,大哥牛逼. 黄翔 发表于 2024-6-11 11:57
谢谢大哥,大哥威武.
页:
[1]
2