KO你 发表于 2021-12-23 16:52:31

讨论串通命令

快捷键ED编辑文字与标注
(defun c:ed () (command"textedit"));;高版本的
(defun c:ed () (command"ddedit"));;低版本的

怎样串通命令符,输入ED后在ddedit失效后自动运行textedit
这只是一个思路
望路过的大师高手们高抬贵手

gaics 发表于 2021-12-24 07:58:42

(defun c:ed ()
(if (vl-cmdf "ddedit")
    (vl-cmdf "textedit")
)
)
这样貌似可以。没有低版本,未测试。

命令: ed 未知命令“DDEDIT”。按 F1 查看帮助。

当前设置: 编辑模式 = Multiple
T

选择注释对象或 [放弃(U)/模式(M)]:

菜卷鱼 发表于 2021-12-24 10:57:46

本帖最后由 菜卷鱼 于 2021-12-24 11:09 编辑

(defun c:ed (/ cmds)
   (setq cmds(if (type command-s) command-s vl-cmdf))
   (if (type textedit)
   (cmds "_.textedit")
   (cmds "_.ddedit")
   )
)

(defun c:ed (/ cm1 cm2)
   (setq cm1 (if (type command-s) 'command-s 'command))
   (setq cm2 (if (type textedit) "_.textedit" "_.ddedit"))
   (setvar 'cmdecho 0)
   (apply cm1 (list cm2))
   (prin1)
)

页: [1]
查看完整版本: 讨论串通命令