明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2473|回复: 7

[源码] 新鲜出炉,绘制楼梯梯段剖面

[复制链接]
发表于 2015-7-17 11:43 | 显示全部楼层 |阅读模式
不说了,直接发源码,欢迎批评指正。
  • (defun c:tt ()
  •   (setq n_lenth (float (getint "\n楼梯跨度:")))
  •   (setq n_high (float (getint "\n楼梯高度:")))
  •   (setq n_num (float (getint "\n楼梯踏步数:")))
  •   (setq n_thick (float (getint "\n楼梯梯板厚度:")))
  •   (setq n_tlb (float (getint "\n梯梁宽度:")))
  •   (setq n_tlh (float (getint "\n梯梁高度:")))
  •   (setq n_s_lenth  (/ n_lenth n_num))
  •   (setq n_s_high  (/ n_high (+ n_num 1)))
  •   (n_hualouti)
  • )
  • (defun n_hualouti ()
  •   (setq p1 (getpoint "点取起始点:"))
  •   (setq p_start p1)
  •   (setq n_count n_num)
  •   (while (>= n_count 1)
  •     (setq n_count (1- n_count))
  •     (n_huatabu)
  •   )
  • (setq p_start1 (polar p_start (* pi 1.5) (/ n_thick (cos (angle p_start p_end)))))  
  •   (setq p_end1 (polar p_end (* pi 1.5) (/ n_thick (cos (angle p_start p_end)))))
  •   (setq pl1 (polar p_start pi n_tlb))
  •   (setq pl2 (polar pl1 (* pi 1.5) n_tlh))
  •   (setq pl3 (polar pl2 0 n_tlb))
  •   (setq pl4 (polar p_end (* pi 0.5) n_s_high))
  •   (setq pl5 (polar pl4 0 n_tlb))
  •   (setq pl6 (polar pl5 (* pi 1.5) n_tlh))
  •   (setq pl7 (polar pl6 pi n_tlb))
  •   (command "PLINE" p_start pl1 pl2 pl3 p_start1 p_end1 pl7 pl6 pl5 pl4 p_end "")
  • )
  • (defun n_huatabu ()
  •   (setq p2 (polar p1 (* pi 0.5) n_s_high))
  •   (command "pline" p1 p2 "")
  •   (setq p1 p2)
  •   (setq p2 (polar p1 0 n_s_lenth))
  •   (command "pline" p1 p2 "")
  •   (setq p1 p2)
  •   (setq p_end p2)
  • )

真正意义上自己编的一个小程序,请高手斧正,不胜感激

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
 楼主| 发表于 2015-7-17 11:44 | 显示全部楼层
沙发自己坐喽
发表于 2015-7-17 13:18 | 显示全部楼层
支持楼主发源码!!
发表于 2015-7-17 17:21 | 显示全部楼层
支持!!!!
发表于 2015-7-17 20:53 | 显示全部楼层
虽然很少用到,纯支持。
发表于 2015-7-17 22:49 | 显示全部楼层
楼主上传个lsp文件吧
 楼主| 发表于 2015-7-19 15:21 | 显示全部楼层
新的程序已经上传到新贴了,由于有问题没解决,直接是以提问贴的形式重新做了,源码也在新帖http://bbs.mjtd.com/thread-168803-1-1.html
 楼主| 发表于 2015-7-19 23:08 | 显示全部楼层
问题解决了,增加了菜单控制,源码放在http://bbs.mjtd.com/thread-168805-1-1.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-6 19:50 , Processed in 0.206077 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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