明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 758|回复: 2

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

[复制链接]
发表于 2008-6-28 22:29 | 显示全部楼层 |阅读模式
(defun c:a4( / v1 v2 v3 ljmch cl shl bl)
   (setq v1(getvar "osmode"))
   (setq v2(getvar  "cmdecho"))
   (setq v3(getvar "bilpmode"))
   (setvar "osmode" 0)
   (setvar "cmdecho" 0)
   (setvar "bilpmode" 0)
  (setq ljmch(getstring "\n输入零件名称:"))
  (setq cl(getstring "\n输入零件材料:"))
  (setq shl (getint "\n输入零件数量:"))
  (setq shl(itoa shl))
  (setq bl(getstring "\n输入绘图比例"))
  (command "style" "hz" "gbcgig" "" "" "" "" "" "" "")
  (command "layer" "m" "xixian" ) ;设置图纸边框线
  (command "c" 1)
  (command "limits" "0,0" "210,297")
  (command "zoom" "a")
  (command "line" "0,0" "210,0" "210,297" "c")
  (command "layer" "m" "cuxian" "c" 7 "" "lw" 0.6 "");设置图框
  (command "line" "25,5" "205,5" "205,292" "25,292" "c")
  (command "line" "85,5" "85,27" "205,13" "")
  (command "line" "85,13" "205,13" "")
  (command "line" "100,13" "100,27" "")
  (command "line" "120,13" "120,27" "")
  (command "line" "132,5" "132,27" "")
  (command "line" "162,5" "162,13" "")
  (command "line" "180,5" "180,27" "")
  (command "layer" "m" "xixian")
  (command "line" "85,20" "132,20")
  (command "layer" "m" "wenzi" "c" "5" "" "")
  (command "text" "m" (list 188.5 9) 5 0 "清华大学机械厂")
  (command "text" "m" (list 147 9) 5 0 (strcat"材料" cl))
   (command "text" "m" (list 171 9) 5 0 (strcat"数量" shl))
   (command "text" "m" (list 192.5 9) 5 0 (strcat"比例" bl))
    (command "text" "m" (list 92.5 23.5) 5 0 "制图")
    (command "text" "m" (list 92.5 16.5) 5 0 "校核")
    (command "text" "m" (list 156 20) 10 0 ljmch)
  (setvar "osmode")
  (setvar "cmdecho" v2)
  (setvar "blipmode" v3)
  (princ)
  )
发表于 2008-6-28 23:04 | 显示全部楼层

  ...

  (setvar "osmode" v1)
  (setvar "cmdecho" v2)
  (setvar "blipmode" v3)
  (princ)
  )

发表于 2008-6-28 23:08 | 显示全部楼层

More .....
  (command "layer" "m" "xixian" ) ;设置图纸边框线
  (command "c" 1)
==> 
  (command "c" 1 "" "")


(command "line" "25,5" "205,5" "205,292" "25,292" "c")
===>
(command "line" "25,5" "205,5" "205,292" "25,292" "c")

.....

(command "line" "180,5" "180,27" "")
(command "layer" "m" "xixian")
==>
;; (command "layer" "m" "xixian" "")   ; 重复了

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-28 04:33 , Processed in 0.331725 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表