绘多义线角平分线.lsp*****主题付费,附件免费

fsy124618 发表于 2011-9-9 10:14:49 | 显示全部楼层 | 阅读模式
本帖最后由 fsy124618 于 2011-9-9 10:22 编辑

绘多义线角平分线.lsp
自己花了一天时间写的


  1. ===================================================================
  2. ;;;功能:等分角平分线工具dfj
  3. ;;;作者:biaoge124 日期:2011.9.8
  4. ===================================================================
  5. (defun c:dfj ()
  6. ;;; 定义系统变量
  7. (setq osn (getvar "osmode"))
  8. (setvar "osmode" 0)
  9. (setvar "cmdecho" 0)
  10. ;;; 选取对象,必须为多义线
  11. (setq en (car (entsel "\n选取多边形:")))
  12. (setq ent (entget en))
  13. (setq i 0)
  14. ;;; 定义空集
  15. (setq plptll '())
  16. ;;; 提取多义线点集
  17. (if (null ent)
  18. ()
  19. (progn
  20. (repeat (length ent)
  21. (setq entnn (nth i ent))
  22. (if (= (car entnn) 10)
  23. (setq
  24. plptll (cons (cdr entnn) plptll)
  25. )
  26. )
  27. (setq i (1+ i))
  28. )
  29. )
  30. )
  31. (setq plptll (reverse plptll))
  32. ;;;绘第一个角平分线
  33. (setq ii 1)
  34. (setq ptii (nth 0 plptll))
  35. (setq ptii+ (nth 1 plptll))
  36. (setq ptii- (nth (1- (length plptll)) plptll))
  37. (fsy_dfcz)
  38. ;;;绘中间点角平分线
  39. (repeat (- (length plptll) 2)
  40. (setq ptii (nth ii plptll))
  41. (setq ptii+ (nth (1+ ii) plptll))
  42. (setq ptii- (nth (1- ii) plptll))
  43. (fsy_dfcz)
  44. (setq ii (1+ ii))
  45. )
  46. ;;;绘最后一个角平分线
  47. (setq ptii+ (nth 0 plptll))
  48. (setq ptii- (nth (- (length plptll) 2) plptll))
  49. (setq ptii (nth (1- (length plptll)) plptll))
  50. (fsy_dfcz)
  51. (setvar "osmode" osn)
  52. (princ "谢谢使用biaoge124的等分角平分线工具 命令:dfj")
  53. (princ)
  54. )
  55. ;;;"biaoge124"
  56. ===================================================================
  57. ===================================================================

  58. ;;;具体等分操作
  59. (defun fsy_dfcz ()
  60. (setq ptang1 (angle ptii ptii+)
  61. ptang2 (angle ptii ptii-)
  62. )
  63. (if (< (abs (- ptang1 ptang2)) pi)
  64. (progn (setq ptang (/ (+ ptang1 ptang2) 2.0))
  65. (command "pline"
  66. ptii
  67. (polar ptii ptang (distance ptii ptii+))
  68. ""
  69. )
  70. )
  71. (progn
  72. (setq ptang (+ (/ (+ ptang1 ptang2) 2.0) pi)
  73. )
  74. (command "pline"
  75. ptii
  76. (polar ptii ptang (distance ptii ptii+))
  77. ""
  78. )
  79. )
  80. )
  81. )
  82. ;;;"biaoge124"
  83. ===================================================================
  84. ===================================================================
复制代码
另附动画
dfj.gif

绘多义线角平分线0.lsp

2.13 KB, 下载次数: 7

精彩评论倒序浏览

5007查看4评论

农大哥2013... 发表于 2011-9-9 10:28:02
楼主,要是不好的话可以退不!嘿!
举报 回复
fsy124618 发表于 2011-9-9 10:30:03
http://www.bridgehead.com.cn/thread-40231-1-1.html
看看这个
如果有需要可以在那里留言
我给你写个
初学
举报 回复
农大哥2013... 发表于 2011-9-9 10:41:44
fsy-plpt这个命令咋不行呢
举报 回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

 
 
  • QQ:56984982
  • 点击这里给我发消息
    电话:13527553862
    站务咨询群桥头堡站务咨询桥梁专业交流群:
    中国桥梁专业领袖群
    工作时间
    8:00-18:00