明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1578|回复: 5

请达人门进来帮忙看一下是什么问题!

[复制链接]
发表于 2004-9-26 01:28:00 | 显示全部楼层 |阅读模式
为什么我这个程序画不了这样的图 不知道程序错在什么地方 请大虾们指点一下 感激不尽 (defun C:ring();
(setq pt (getpoint"输入圆心坐标:"));
(setq r1 (getreal"输入内圆半径:"));
(setq r2 (getreal"输入小圆半径:"));
(setq r3 (getreal"输入外圆半径:"));
(setq n (getint"输入小圆个数:"));
(setq pai 6.28318);
(command "circle" pt r1);
(command "circle" pt r3);
(setq r (/ (+ r1 r3) 2));
(command "layer" "M" "1" "C" "BLUE" "1" "L" "CENTER" "1" "S" "1");
(command);
(command "circle" pt r);
(command "layer" "M" "2" "C" "RED" "2" "S" "2");
(command);
(setq ang 0);
(setq k 1);
(while (<= k n);
(setq ang (+ ang (/ pai n)));
(setq ptn (polar pt ang r));
(command "circle" ptn r2);
(setq k (+ 1 k));
);
);

本帖子中包含更多资源

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

x
 楼主| 发表于 2004-9-26 02:14:00 | 显示全部楼层
有知道问题的人指点一下


谢谢了
发表于 2004-9-26 07:48:00 | 显示全部楼层

回复

(defun C:ring()
(setvar "osmode" 0) ;***(注意关闭捕捉)
(setq pt (getpoint"输入圆心坐标:"))
(setq r1 (getreal"输入内圆半径:"))
(setq r2 (getreal"输入小圆半径:"))
(setq r3 (getreal"输入外圆半径:"))
(setq n (getint"输入小圆个数:"))
(setq pai 6.28318);
(command "circle" pt r1)
(command "circle" pt r3)
(setq r (/ (+ r1 r3) 2))
(command "layer" "M" "1" "C" "BLUE" "1" "L" "CENTER" "1" "S" "1" "")
(command "circle" pt r2)
(command "layer" "M" "2" "C" "RED" "2" "S" "2" "")

(setq ang 0)
(while (<= ang pai)

(setq ptn (polar pt ang r))
(command "circle" ptn r)
(setq ang (+ ang (/ pai n)))
)
)
 楼主| 发表于 2004-9-26 10:27:00 | 显示全部楼层
谢谢         我把 对象捕捉关闭了就可以了         谢谢
发表于 2004-9-26 21:02:00 | 显示全部楼层
题外话,怎么有人抢注了偶的名号,:)
 楼主| 发表于 2004-9-26 22:06:00 | 显示全部楼层
没有想到 还有这个名号         我一直都在用这个


看来我们还是挺有缘的:)


以后 罩着小弟啊 !!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-18 16:24 , Processed in 0.194507 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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