athome 发表于 2008-6-28 22:29:00

帮忙看看这段代码,提示参数太少

(defun c:a4( / v1 v2 v3 ljmch cl shl bl)<br/>&nbsp;&nbsp; (setq v1(getvar "osmode"))<br/>&nbsp;&nbsp; (setq v2(getvar&nbsp; "cmdecho"))<br/>&nbsp;&nbsp; (setq v3(getvar "bilpmode"))<br/>&nbsp;&nbsp; (setvar "osmode" 0)<br/>&nbsp;&nbsp; (setvar "cmdecho" 0)<br/>&nbsp;&nbsp; (setvar "bilpmode" 0)<br/>&nbsp; (setq ljmch(getstring "\n输入零件名称:"))<br/>&nbsp; (setq cl(getstring "\n输入零件材料:"))<br/>&nbsp; (setq shl (getint "\n输入零件数量:"))<br/>&nbsp; (setq shl(itoa shl))<br/>&nbsp; (setq bl(getstring "\n输入绘图比例"))<br/>&nbsp; (command "style" "hz" "gbcgig" "" "" "" "" "" "" "")<br/>&nbsp; (command "layer" "m" "xixian" ) ;设置图纸边框线<br/>&nbsp; (command "c" 1)<br/>&nbsp; (command "limits" "0,0" "210,297")<br/>&nbsp; (command "zoom" "a")<br/>&nbsp; (command "line" "0,0" "210,0" "210,297" "c")<br/>&nbsp; (command "layer" "m" "cuxian" "c" 7 "" "lw" 0.6 "");设置图框<br/>&nbsp; (command "line" "25,5" "205,5" "205,292" "25,292" "c")<br/>&nbsp; (command "line" "85,5" "85,27" "205,13" "")<br/>&nbsp; (command "line" "85,13" "205,13" "")<br/>&nbsp; (command "line" "100,13" "100,27" "")<br/>&nbsp; (command "line" "120,13" "120,27" "")<br/>&nbsp; (command "line" "132,5" "132,27" "")<br/>&nbsp; (command "line" "162,5" "162,13" "")<br/>&nbsp; (command "line" "180,5" "180,27" "")<br/>&nbsp; (command "layer" "m" "xixian")<br/>&nbsp; (command "line" "85,20" "132,20")<br/>&nbsp; (command "layer" "m" "wenzi" "c" "5" "" "")<br/>&nbsp; (command "text" "m" (list 188.5 9) 5 0 "清华大学机械厂")<br/>&nbsp; (command "text" "m" (list 147 9) 5 0 (strcat"材料" cl))<br/>&nbsp;&nbsp; (command "text" "m" (list 171 9) 5 0 (strcat"数量" shl))<br/>&nbsp;&nbsp; (command "text" "m" (list 192.5 9) 5 0 (strcat"比例" bl))<br/>&nbsp;&nbsp;&nbsp; (command "text" "m" (list 92.5 23.5) 5 0 "制图")<br/>&nbsp;&nbsp;&nbsp; (command "text" "m" (list 92.5 16.5) 5 0 "校核")<br/>&nbsp;&nbsp;&nbsp; (command "text" "m" (list 156 20) 10 0 ljmch)<br/>&nbsp; (setvar "osmode")<br/>&nbsp; (setvar "cmdecho" v2)<br/>&nbsp; (setvar "blipmode" v3)<br/>&nbsp; (princ)<br/>&nbsp; )

caoyin 发表于 2008-6-28 23:04:00

<p>&nbsp; ...</p><p>&nbsp; (setvar "osmode" <font color="#ff0000">v1</font>)<br/>&nbsp; (setvar "cmdecho" v2)<br/>&nbsp; (setvar "blipmode" v3)<br/>&nbsp; (princ)<br/>&nbsp; )</p>

Andyhon 发表于 2008-6-28 23:08:00

<p>More .....<br/>&nbsp; (command "layer" "m" "xixian" ) ;设置图纸边框线<br/>&nbsp; (command "c" 1)<br/>==&gt;&nbsp; <br/>&nbsp; (command "c" 1 "" "")</p><p><br/>(command "line" "25,5" "205,5" "205,292" "25,292" "c")<br/>===&gt;<br/>(command "line" "25,5" "205,5" "205,292" "25,292" "c")</p><p>.....</p><p>(command "line" "180,5" "180,27" "")<br/>(command "layer" "m" "xixian")<br/>==&gt;<br/>;; (command "layer" "m" "xixian" "")&nbsp;&nbsp; ; 重复了</p><p></p>
页: [1]
查看完整版本: 帮忙看看这段代码,提示参数太少