乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 91|回复: 3

[编程交流] 需要一点帮助

[复制链接]

1

主题

1

帖子

0

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 08:30:36 | 显示全部楼层 |阅读模式
所以我在autolisp上遇到了一个问题,我需要制作一个程序来绘制一个简单的表单。我写的程序,但它说,有一个错误的地方,我不能找到它。我来自立陶宛,所以一些文本你不会理解,但它并不重要,所以这里是程序,我附上了文件。
 
  1. ; -------------------------------------------------------
  2. ; profa.lsp
  3. ; Profilio braižymas
  4. ; DB0/3 gr. stud. G., Sveikataitė
  5. ; D. Kalisinskas
  6. ; KTU, Inžinerinės grafikos katedra.
  7. ; --DTR funkcijos įvedimas į programą-----
  8. (defun dtr (alfa)
  9.        (* pi (/ alfa 180.0))
  10.    )
  11. ;Duomenų įvedimas: p0, L, L1, H, c, b, R1, W, Fi
  12.    (defun duom ()
  13.        (setq p0 (getpoint "\nPazymekite bazini taska p0:"))
  14.        (setq L (getdist "\nProfilio plotis L <30>:"))
  15.        (if (null L) (setq b0 30))
  16.        (setq L1 (getdist "\nprofilio plotis L1 <9>:"))
  17.        (if (null L1) (setq L1 9))
  18.        (setq H (getdist "\nprofilio aukstis H <30>:"))
  19.        (if (null H) (setq h0 30))
  20.        (setq c (getdist "\nprofilio aukstis c <3>:"))
  21.        (if (null c) (setq c 3))
  22.        (setq b (getdist "\nprofilio aukstis b <6>:"))
  23.        (if (null b) (setq b 6))
  24.        (setq R1 (getdist "\nuzapvalinimo spindulys R1 <10.5>:"))
  25.        (if (null R1) (setq R1 10.5))
  26.        (setq w (getdist "\npolilinijos plotis <0.5>:"))
  27.        (if (null w) (setq w 0.5))
  28.        (setq Fi (getdist "\nprofilio pasukimo kampas Fi <0.0>:"))
  29.        (if (null Fi) (setq Fi 0.0))
  30.         )
  31. ;--Taškų Koordinačių paskaičiavimas-----
  32. (defun piont ()
  33.        (setq p1 (polar p0 (dtr 90) H))
  34.        (setq p2 (polar p1 0 L1))
  35.        (setq p3 (list (car p2) (- (cadr p2) c)))
  36.        (setq p4 (polar p3 (dtr 315)(* R1(sqrt 2)))
  37. (setq p5 (polar p4 (dtr -315)(* R1(sqrt 2)))      
  38.        (setq p6 (polar p5 (dtr -90) b0))
  39. )
  40. ;--Profilio braizymas--
  41. (defun braiz ()
  42.        (command "PLINE" p0 "w" w "" p1 p2 p3 "ARC" "ANGLE" "-90" p4 "ARC" "ANGLE" "90" p5 "b0" p6 p0 "")
  43.        (setq PL1 (entlast))
  44.        (command "ROTATE" PL1 "" p0 Fi)
  45.        (steq PL2 (entnext PL1))
  46.        (command "hatch" "ansi31" 1 0 PL1 "")
  47.         )
  48. ;--Pagrindine programa-------------------------------------------
  49.   --Pagrindine programa--
  50. (defun C:PROF1 ()
  51.       (dtr)
  52.       (duom)
  53.       (braiz)

误差从这一行开始(setq p4(极性p3(dtr 315)(*R1(sqrt 2)))直到底部
Autolisp2.zip
回复

使用道具 举报

4

主题

2143

帖子

2197

银币

限制会员

铜币
-24
发表于 2022-7-6 08:55:37 | 显示全部楼层
请阅读代码发布指南。
回复

使用道具 举报

1

主题

1069

帖子

1050

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
69
发表于 2022-7-6 09:24:47 | 显示全部楼层
欢迎加入
我在你的代码中发现了一些不平衡的括号
尝试编辑lisp:
  1. ; -------------------------------------------------------
  2. ; profa.lsp
  3. ; Profilio braizymas
  4. ; DB0/3 gr. stud. G., Sveikataite
  5. ; D. Kalisinskas
  6. ; KTU, Inzinerines grafikos katedra.
  7. ; --DTR funkcijos ivedimas i programa-----
  8. (defun dtr (alfa)
  9. (* pi (/ alfa 180.0))
  10. )
  11. ;Duomenu ivedimas: p0, L, L1, H, c, b, R1, W, Fi
  12. (defun duom ()
  13. (setq p0 (getpoint "\nPazymekite bazini taska p0:"))
  14. (setq L (getdist "\nProfilio plotis L <30>:"))
  15. (if (null L) (setq b0 30))
  16. (setq L1 (getdist "\nprofilio plotis L1 <9>:"))
  17. (if (null L1) (setq L1 9))
  18. (setq H (getdist "\nprofilio aukstis H <30>:"))
  19. (if (null H) (setq H 30));was ho
  20. (setq c (getdist "\nprofilio aukstis c <3>:"))
  21. (if (null c) (setq c 3))
  22. (setq b (getdist "\nprofilio aukstis b <6>:"))
  23. (if (null b) (setq b 6))
  24. (setq R1 (getdist "\nuzapvalinimo spindulys R1 <10.5>:"))
  25. (if (null R1) (setq R1 10.5))
  26. (setq w (getdist "\npolilinijos plotis <0.5>:"))
  27. (if (null w) (setq w 0.5))
  28. (setq Fi (getdist "\nprofilio pasukimo kampas Fi <0.0>:"))
  29. (if (null Fi) (setq Fi 0.0))
  30. )
  31. ;--Tasku Koordinaciu paskaiciavimas-----
  32. (defun piont ()
  33. (setq p1 (polar p0 (dtr 90) H))
  34. (setq p2 (polar p1 0 L1))
  35. (setq p3 (list (car p2) (- (cadr p2) c)))
  36. (setq p4 (polar p3 (dtr 315)(* R1(sqrt 2))))
  37. (setq p5 (polar p4 (dtr -315)(* R1(sqrt 2))))
  38. (setq p6 (polar p5 (dtr -90) b0))
  39. )
  40. ;--Profilio braizymas--
  41. (defun braiz ()
  42. (command "PLINE" "_non" p0 "w" w "" "_non" p1 "_non" p2 "_non" p3 "ARC" "ANGLE" "-90" "_non" p4 "ARC" "ANGLE" "90" "_non" p5 "L" "_non" p6 "_non" p0 "")
  43. (setq PL1 (entlast))
  44. (command "ROTATE" PL1 "" p0 Fi)
  45. (setq PL2 (entnext PL1))
  46. (command "hatch" "ansi31" 1 0 PL1 "")
  47. )
  48. ;--Pagrindine programa-------------------------------------------
  49. (defun C:ROF1 ()
  50. (duom)
  51. (piont)
  52. (braiz)
  53. (princ)
  54. )
  55. (C:ROF1);<-- autorun for debug
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 09:33:06 | 显示全部楼层
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-7 09:11 , Processed in 1.174437 second(s), 60 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表