明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1228|回复: 5

请高手们前来解释程序!!!!!

[复制链接]
发表于 2005-5-20 10:32 | 显示全部楼层 |阅读模式
;gear.lip (defun grinfo ()
(setq c (getpoint "\n 齿轮中心: "))
(setq pc (getpoint "\n 节距圆: "))
(setq teeth (getint "\n 齿数: "))
(while (< teeth 14)
(setq teeth (getint "\n 必须至少14个齿: "))
)
(while (> teeth 50)
(setq teeth (getint "\n 必须不超过50个齿: "))
)
;; (while(< teeth 14)(setq teeth(getint "\n 必须至少14个齿: ")))
;;(while(> teeth 50)(setq teeth(getint "\n 必须不超过50个齿: ")))
) (defun calgear ()
(setq d (* 2 (distance c pc)))
(setq pc (polar c 0 (/ d 2)))
(setq ang3 2.79248)
(setq ang5 (/ 360.000000 teeth))
(setq wang -0.785385)
(setq wang 20.785385)
(setq dp (/ teeth d))
(setq ht (/ 0.32 dp))
(setq adm (/ 1.0 dp))
(setq y (* (/ 2.257 dp) 1.0642))
) (defun drawgear ()
(command "PLINE"
(setq p (polar pc 0 adm))
"a"
"ce"
c
"l"
ht
"l"
(setq p (polar (getvar "lastpoint") ang3 y))
"a"
"ce"
c
"l"
ht
"" )
(SETQ TOP (GETvar "LASTPOINT"))
(command "MIRROR"
"L"
""
(setq p (polar pc 0 adm))
c
"n"
)
(command "ARRAY"
"w"
(POLAR TOP 4.712389 (* Y 1.5))
(polar TOP 0 Y)
""
"c"
c
ang5
"-360"
"Y"
)
)
(defun C:GEAR ()
(grinfo)
(setq stdots (getvar "blipmode"))
(setq stech (getvar "cmdecho"))
(setvar "blipmode" 0)
(setvar "cmdecho" 0)
(calgear)
(drawgear)
(setvar "blipmode" stdots)
(setvar "cmdecho" stech)
)
(prompt "\n键入Gear换起命令: ") 这是一个正确的齿轮程序, 小弟我还看不太懂,希望各路高手能帮我解释解释(最好一步一步来)谢谢!!!
发表于 2005-5-20 20:33 | 显示全部楼层
你对着函数一句一句看会看不懂的吗?
发表于 2005-5-20 20:38 | 显示全部楼层
典型的不愿意打好基础,就想写出程序的,急于求成的学习方法,,,,,,不可取!
 楼主| 发表于 2005-5-21 01:19 | 显示全部楼层
各位,误会了,我是很想学VISUAL LISP的!



只是现在时间仓促,来不及慢慢学了,过几天就要论文答辩,老师要求要看得懂程序,不能答非所问,而我又是初学者,没一点基础,所以才走此捷径来请教你们的!!!


希望大家能帮我这个忙,小弟我感激不尽!!!


我愿成为VISUAL LISP 中人,和大家一起进步,,,,!!!!


有劳大家了!!!!!!
发表于 2005-5-21 08:41 | 显示全部楼层
呵呵,我也刚学,可以看懂一点。:)
 楼主| 发表于 2005-5-21 09:02 | 显示全部楼层
(defun calgear ()
(setq d (* 2 (distance c pc)))
(setq pc (polar c 0 (/ d 2)))
(setq ang3 2.79248)
(setq ang5 (/ 360.000000 teeth))
(setq wang -0.785385)
(setq wang 20.785385)
(setq dp (/ teeth d))
(setq ht (/ 0.32 dp))
(setq adm (/ 1.0 dp))
(setq y (* (/ 2.257 dp) 1.0642))
) 大家先帮我解释这段吧,让我看看回去琢磨琢磨,谢谢!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-29 02:21 , Processed in 0.335192 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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