Lt Dan's l 发表于 2022-7-6 10:45:16

命令激活时的菜单

如何在命令仍处于活动状态的情况下提供选项?显示当前设置如何?
 
例子:
Command: ML

Current settings: Justification = Zero, Scale = 1.00, Style = BWALL
Specify start point or :
 
请回答Autolisp

Lt Dan's l 发表于 2022-7-6 10:55:24

 
我找到了第一部分。
menucmd
 
仍在想设置显示

Lee Mac 发表于 2022-7-6 11:10:43

不需要menucmd。
 
所有GetXXX函数都将支持关键字-使用initget。
 
对于当前设置,只需使用princ调用。

Lt Dan's l 发表于 2022-7-6 11:13:53

 
当我输入menucmd时,我正在看旧的dline lisp。我想我已经解决了,但当我意识到不是你回答了我的问题。
 
我认为有一个不同的方式做普林斯通话,但似乎这是最好的方式。
 
非常感谢。

alanjt 发表于 2022-7-6 11:24:38

除了getstring,原因很明显。

Lt Dan's l 发表于 2022-7-6 11:35:24

我让我的程序按我想要的方式工作。非常感谢李!
 
还有一个问题
(setq wait t)
(while wait ...
 
这只在一段时间内有效,还是有其他命令可以与之配合使用?
 
 
 
___
我和
(progn wait
...也许常规有错误

Lee Mac 发表于 2022-7-6 11:40:21

 
我不知道你是什么意思?

BIGAL 发表于 2022-7-6 11:51:57

您是否需要一个显示所有当前设置的表单,如果正确,请按Ok else选择框并进行更改,该表单可以作为单独的defun写入,并在程序开始时作为步骤调用。
 
或者根据Lee Mac编写所有结果,如果确定,只需按enter键,任何其他键都意味着更改这在程序中非常快,如果在lisp中,则不需要编写dcl。我使用这种输入方法非常方便大家在工作中使用。
 

(princ "all your values here")
(setq ans (getstring ans "\nIf values ok press <Cr> else any key"))
(IF (= ans NIL)
(princ)
(setnewvals)
)

(defun newvals ()
(princ styleval)
(setq ans (getstring ans "\nIf values ok press <Cr> else any key"))
(IF (= ans NIL)
(princ)
(progn
(setq styleval (Getstring "\nEnter new style name"))
(setvar "stylname" stylname)   ; I can nor rember style variable
)
)
just repeat for all other vaules may mean you press Cr Cr enter val Cr Cr etc

 
希望这可能有用
页: [1]
查看完整版本: 命令激活时的菜单