明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1678|回复: 3

求助螺纹该如何编程

[复制链接]
发表于 2005-1-24 19:05:00 | 显示全部楼层 |阅读模式
该如何用Autolisp编写梯形、矩形以及管螺纹的程序。如知道请把程序发到我邮箱tonlu@126.com。 万分感谢!
发表于 2005-1-25 22:51:00 | 显示全部楼层
我需要一个自动编写程序的lisp程序,如果知道的话发到我的邮箱,谢谢了。
发表于 2005-1-28 14:55:00 | 显示全部楼层
我需要一个lisp解密程序,如果知道的话发到我的邮箱,谢谢了。http://
发表于 2005-1-31 09:57:00 | 显示全部楼层

回复

;上传一个绘制罗纹的LISP程序:在程序中,作为刀具的实体不断旋转、移动, ;并从料棒上切削下材料。螺旋槽的截面线需要另外绘制。 (defun c:luowen() (setq i 0 ;循环量
v (/ -1 (* 2 pi))
step 0.05
) ;---------------------------选择作为料棒的圆柱体 (setq e1 (entsel "\n 选择螺杆: "))
(command "ucs" "w" "") ;使用通用坐标系
(command "ucs" "x" "") ;旋转坐标系 ;(setq r 5)
;(command "ucs" "w" "")
;(command "cylinder" "0,0,1" "d" 10 20)
;(setq e1 (entlast)) ;-----------------------------选择截面线,并拉伸成三维实体 (setq eg1 (entsel "\n 选择截面线:"))
(command "extrude" eg1 "" 1 "")
(command "ucs" "w" "")
(command "move" 1 "" "0,0,0" "0,0.5,0")
(setq e2 (entlast)) ;;---------------------------------------使用循环函数,不断复制、旋转、移动螺旋槽减去实体,并从料棒上切削下材料 (while (>= i (* -6 2 pi))
(setq pt1 (list 0 0 (* v i -1))) ;求取实体旋转后的位置点
(command "rotate" e1 "" "0,0,0" (/ (* step -180) pi)) ;旋转实体
(setq i (- i step))
(setq pt2 (list 0 0 (* v i -1)))
(command "copy" e2 "" "0,0,0" "0,0,0")
(setq eg2 (entlast))
(command "move" e1 "" pt1 pt2) ;移动实体
(command "subtract" e1 "" eg2 "") ;切割料棒
)
)
(princ "\n 程序加载完成,请输入 luowen 命令执行: ")
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-29 20:29 , Processed in 0.172243 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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