明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1679|回复: 3

希望高手帮我看看程序

[复制链接]
发表于 2011-1-15 00:28:00 | 显示全部楼层 |阅读模式
我的程序主要功能是建立图层,但输入比例却会出现问题,不相关联。下面的是我的程序:
  1. (defun c:wc ()

  2. (setvar "cmdecho" 0)
  3. (setq ur1 (getvar "userr1"))
  4. (if (= ur1 0) (setq ur1 1))
  5. (setq ur2 (getreal (strcat "\n打印比例 1:" "<" (rtos ur1 2) ">")))
  6. (if (= ur2 nil) (setq ur2 ur1))

  7. (setq r2 (/ ur2 100))
  8. (setvar "userr1" ur2)

  9. (command "-linetype" "l" "center"  "" "" "")
  10. (command "-linetype" "l" "dash1"  "" "" "")
  11. (command "-linetype" "l" "dash"  "" "" "")
  12. (command "ltscale" (* ur2 10))

  13. (command "-style" "GB" "gbxwxt.shx,gbhzfs.shx" (* 250 r2) "0.7" "" "" "" "")
  14. (command "-style" "BH" "romanc.shx" "" "" "" "" "" "")
  15. (command "-style" "DIM_Font" "simplex.shx" "" "" "" "" "" "")
  16. (command "-style" "TM" "SIMFANG.TTF" (* 700 r2) "" "" "" "" "")

  17. ;(command "dimstyle" "s" "STANDARD" "y" "")

  18. (setq p0 (list 0.0 0.0 0.0))
  19. (command "-insert" "whblk.dwg" p0 "1" "1" "1" "0")
  20.   (setq en1 (entlast))
  21.   (entdel en1)


  22.         
  23. (command "dimasz" (* 80 r2) )

  24. (command "dimcen" (* 300 r2))
  25. (command "dimclrt" 7)
  26. (command "dimdec" 0)
  27. (command "dimdli" 0.0000)
  28. (command "dimexe" (* 200 r2))
  29. (command "dimexo" (* 300 r2))
  30. (command "dimgap" (* 80 r2))
  31. (command "dimtxsty" "GB")
  32. (command "dimtxt" (* 250 r2))
  33. (command "dimtmove" 2)

  34. (command "layer" "m" "DOTE" "m" "AXIS" "m" "AXIS_TEXT" "m" "DIM" "m" "DT" "m" "DT-BH" "m" "DT-FZ" "")
  35. (command "layer" "m" "C-T0" "m" "C-T1" "m" "C-H" "m" "Q-L0" "m" "Q-H" "m" "R-L0" "m" "R-L1" "")
  36. (command "layer" "m" "L-K0" "m" "L-K1" "m" "L-BH" "m" "L-HH" "m" "L-H" "m" "L-VV" "m" "L-V" "")
  37. (command "layer" "m" "BJ-L" "m" "BJ-T" "m" "JB-L" "m" "JB-H" "m" "HJ-H" "m" "H0" "m" "R0" "m" "R1" "")
  38. (command "layer"  "m" "TM" "m" "JM" "m" "LK" "m" "D0" "m" "D1" "m" "1" "m" "2" "m" "defpoints" "")  


  39. ;(command "layer" "n" "DOTE,AXIS,AXIS_TEXT,C-T0,C-T1,C-H,DIM,Q-L0,Q-H,R-L0,R-L1" "")

  40. ;(command "layer" "n" "L-K0,L-K1,L-BH,L-HH,L-H,L-VV,L-V,BJ-L,BJ-T,JB-L,JB-H,LK,HJ-H" "")

  41. ;(command "layer" "n" "DT,DT-BH,DT-FZ,R0,R1,TM,JM,D0,D1,H0,1,2,defpoints" "")

  42. ;(command "layer" "n" "JC-L,CT-X,CT-S,ZH-L,ZH-L400,ZH-L500,ZH-L600,ZBH" "")
  43. ;(command "layer" "n" "D-W,D-E,D-H,D-T,D-G" "")

  44. (command "layer" "c" 1 "DOTE,JB-H" "")
  45. (command "layer" "c" 2 "BJ-L,R0,R1,2" "")
  46. (command "layer" "c" 3 "AXIS,DIM,Q-L0,L-BH,BJ-T,LK,HJ-H,DT,DT-FZ,TM,1" "")
  47. (command "layer" "c" 4 "L-K0,L-K1,JB-L,JM" "")
  48. (command "layer" "c" 8 "C-H" "c" 9 "H0" "c" 10 "D0,D1" "c" 11 "R-L0,R-L1" "c" 50 "C-T0,C-T1" "")

  49. (command "layer" "l" "CENTER"  "DOTE" "l" "DASH1" "HJ-H" "")
  50. (command "layer" "l" "DASH"  "C-T1,R-L1,L-K1,R1,D1" "")
  51. (command "regen")
  52. (princ)
  53. (princ)(princ)(princ)(princ)(princ)

  54. )

 楼主| 发表于 2011-1-16 13:59:18 | 显示全部楼层
希望楼主帮我看看啊。谢谢各位了。
 楼主| 发表于 2011-1-17 09:18:09 | 显示全部楼层
上面打错了,希望版主帮我看看啊。
 楼主| 发表于 2015-8-11 22:03:01 | 显示全部楼层
这么多年过去了,发现自己也知道了最基本的东西,求人不如求自己,多学习总会有长进。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-25 13:17 , Processed in 0.170739 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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