只需一步,快速开始
使用道具 举报
我是想在命令行实现这样的操作,怎么去定义这个函数
不用非输入-p吧?下面程序在提示输入字串时空回车默认前次输入字串。(defun c:test () (setq str1 (getstring (strcat "\nEnter a string " (if (/= str "") (strcat "<" str "> :") ":")))) (setq str (if (/= str1 "") str1 str)) (princ str) (princ))
定义一个全局变量
每次执行程序就把这个变量作为默认提示
回车就认为是这个变量值
(if (not (numberp scale))(setq scale 0.5)) (setq temp (getreal "缩放比例")) (if (not temp)(setq temp scale)(setq scale temp))
以上两位的思路是对的,但是代码我怎么调试都达不到要求啊!晕死了。。。
终于搞定了,第一次执行的时候还得判断str是否为nil!多谢大家的帮助啊!
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 ) ©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途
GMT+8, 2025-7-30 05:52 , Processed in 0.150382 second(s), 25 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.