这样是否实现不了?另存文件后打开继续运行程序?
(defun c:sar()(setq el(vl-filename-base (vl-string-trim " " (getvar "dwgname"))))
(setq w2(substr el 1 (vl-string-position (ascii " ") el)))
(setq dir(getvar "dwgprefix"))
(setq el (strcat dir w2 "剪口"))
(command "saveas" 2004 el "y")
(command "open" el "") ;打开刚保存的档案
(command "move" "all" "" "0,0" "0,500" );接着运行未运行完的程序?
(princ)
)
请教下这个有没有实现的可能性?应该如何实现?谢谢
我觉得不行吧 jh3030912 发表于 2023-9-20 22:12
我觉得不行吧
(vla-sendcommand doc-new (strcat "(command \"_.OPEN\")\n" file "\n"))
(vla-sendcommand doc-new "(c:mo)\n")
找到论坛内的相关代码,已经解决:handshake linheyuanpcb 发表于 2023-9-20 22:48
(vla-sendcommand doc-new (strcat "(command \"_.OPEN\")\n" file "\n"))
(vla-sendcommand doc-new "( ...
http://bbs.mjtd.com/forum.php?mod=viewthread&tid=100103&highlight=scr
请看这里 (defun C:c1 ( )
(vl-load-com)
(setvar "sdi" 0)
(setvar "filedia" 0)
(setq file (getfiled "Select a drawing" "" "dwg" 0))
(setq obj-new (vlax-get-acad-object))
(setq doc-new (vla-get-activedocument obj-new))
(vla-sendcommand doc-new (strcat "(command \"_.OPEN\")\n" file "\n"))
(vla-sendcommand doc-new "(c:c2)\n")
(vla-sendcommand doc-new "(close file )\n")
(setvar "filedia" 1)
) 用反应器可以。 这个相当于后台处理相关命令吧。不错
页:
[1]