帮助:导出并在记事本中查看结果
嗨,我使用此代码从一些关闭的折线中导出注释通知。Tis 代码以逗号形式显示结果。如果区域在某些限制之间,则从eatch 选项中选择代码,然后导出为结果,很少通知和 3 次计算。我更容易在记事本中而不是在命令行中阅读它们。是否可以将结果写入 temp txt 并打开记事本?***代码中的文字是随机的,因为翻译成英文的工作人员很多.
**** Hidden Message *****
试试这个:
(defun txttonotepad ( txtlist / txtfile LFDES ) ;;creates list of LISPs to notepad
(if (strcat (getvar "TEMPPREFIX") "txtlist.txt")(vl-file-delete (strcat (getvar "TEMPPREFIX") "txtlist.txt"))) ;;delete existing file
(setq txtfile (strcat (getvar "TEMPPREFIX") "txtlist.txt")) ;;create new temp file
(setq LFDES (open txtfile "w"))
(foreach x txtlist
(write-line x LFDES)
)
(setq LFDES (close LFDES))
(if (findfile txtfile) (startapp "notepad" txtfile))
(if (not (findfile txtfile)) (princ "\nError writing file"))
(princ)
)
发送到这里的文本是一个列表,每个列表项都是一个新行:
例如:
(txttonotepad (list "Item 1" "Item 2" "Item 3"))如果您修改代码以从命令行中显示的内容创建列表,它应该可以工作。
页:
[1]