明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1414|回复: 0

[讨论] 改变参数为何程序就不能实现了

[复制链接]
发表于 2010-4-14 13:45:00 | 显示全部楼层 |阅读模式

(defun c:luoxuan(/ b1 r1 disp n )
(setvar "cmdecho" 0)
(setq b1 (getpoint "请指定螺旋线基点: "))
(setq r1 (getreal "请输入螺纹平均半径: "))
(setq disp (getreal "请输入螺纹节距: "))
(setq n (getint "请输入每圈细化段数: "))

(command "ucs" "w")
(setq delta (/ (* 0.5 pi) n))
(setq j (/ disp n))
(setq bb (caddr b1))
(setq ang 0)
(setq jj 0)
(Command "UCS" "o" b1)
(Command "3dpoly" (list r1 0 0))
(repeat n
(setq jj(+ jj 1))
(setq ang(+ delta ang))
(setq pt2(list (* r1 (cos ang)) (* r1 (sin ang)) (+ 0 (* j jj))))
(Command pt2)
)
(Command "")
(setq e1(entlast))
(command "ucs" "n" "x" "")
(setq p1'(1 1))
(setq p2'(2 9))
(setq p3'(5 9))
(setq p4'(6 1))
(command "pline" p1 p2 p3 p4 "c")
(setq e2(entlast))
(command "extrude" e2 "" "p" e1 "" )
(entdel e1)

这是个让一个梯形沿一段螺旋线拉伸的程序,如果输入某一组参数是,程序是能实现的,但是如果改变参数积不行了,不知道为什么?

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

本版积分规则

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

GMT+8, 2024-10-1 23:39 , Processed in 0.161765 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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