明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1677|回复: 4

[求助][LISP]為什麼會重覆

[复制链接]
发表于 2004-8-12 20:05:00 | 显示全部楼层 |阅读模式
请教版大,为什么这个细部放大的程序,放大出来会重覆多一个圆呢? (defun c:FDd()
(setq veracad (atoi (getvar "ACADVER")))
(if (>= veracad 15)
(fdd2000)
)
)
(defun FDd2000(/ e p pc k r n ep)
(setvar "CMDECHO" 0)
(setvar "OSMODE" 0)
(princ )
(setq e (car (entsel"\n局部放大\n此命令之前必须在要放大区域画一个圆\n请选择放大区域圆:"))
pc (cdr (assoc 10(entget e)))
p (getpoint "\n请输入放大后位置:")
k (getreal "\n请输入放大倍数:")
r (cdr (assoc 40 (entget e)))
)
(setq kkk p) (command "copy" "cp" )
(setq n 0 )
(repeat 180
(command (polar pc (/ (* 2 n pi) 180) r))
(setq n (+ n 1))
) (command """" pc p)
(setq n 0)
(setvar "PICKBOX" 5)
(command "zoom" "c" p (* 3 r)) (command "circle" p r)
(setq ep (entlast))
(command "trim" ep "" )
(repeat 180
(command (polar p (/ (* 2 n pi)180) (* r 1.1)))
(command "f" (polar p (/ (* 2 n pi) 180) (* r 1.01)))
(setq n (+ n 1))
(command (polar p (/ (* 2 n pi) 180) (* r 1.01)) "")
)
(command "" "zoom""p")
(command "copyclip" "w" (list (- (car p) r) (- (cadr p) r))
(list (+ (car p) r)(+ (cadr p) r)) "")
(command "erase""c"(list (- (car p) r) (- (cadr p) r))
(list (+ (car p) r)(+ (cadr p) r)) "")
(command "pasteclip" (list (- (car p) r) (- (cadr p) r))) (command "scale""c"(list (- (car p) r) (- (cadr p) r))
(list (+ (car p) r)(+ (cadr p) r)) "" kkk k)
(command "erase"ep"")
(command "redraw")
(setvar "OSMODE" 4261)
(princ)
)
 楼主| 发表于 2004-8-12 21:17:00 | 显示全部楼层
另外是不是有办法可以让放大的地方,标註比例不会跟著变大,而是和平常一样?或者当标註放大的地方时,可以自动改变标註比例为放大的相对缩小比例
发表于 2004-8-13 09:59:00 | 显示全部楼层
(defun c:FDd()
(setq veracad (atoi (getvar "ACADVER")))
(if (>= veracad 15)
(fdd2000)
)
)
(defun FDd2000(/ e p pc k r n ep)
(setvar "CMDECHO" 0)
(setvar "OSMODE" 0)
(setq e (car (entsel"\n局部放大\n此命令之前必?在要放大?域?一??\n???放大?域?:"))
pc (cdr (assoc 10(entget e)))
p (getpoint "\n??入放大后位置:")
k (getreal "\n??入放大倍?:")
r (cdr (assoc 40 (entget e)))
)
(setq kkk p)
(command "copy" "cp" )
(setq n 0 )
(repeat 180
(command (polar pc (/ (* 2 n pi) 180) r))
(setq n (+ n 1))
)
(command """" pc p)
(setq n 0)
(setvar "PICKBOX" 5)
(command "zoom" "c" p (* 3 r)) (command "circle" p r)
(setq ep (entlast))
(command "trim" ep "" )
(repeat 180
(command (polar p (/ (* 2 n pi)180) (* r 1.1)))
(command "f" (polar p (/ (* 2 n pi) 180) (* r 1.01)))
(setq n (+ n 1))
(command (polar p (/ (* 2 n pi) 180) (* r 1.01)) "")
)
(COMMAND "")
(command "erase"ep"")
(command "" "zoom""p")
(command "copyclip" "w" (list (- (car p) r) (- (cadr p) r))
(list (+ (car p) r)(+ (cadr p) r)) "")
(command "erase""c"(list (- (car p) r) (- (cadr p) r))
(list (+ (car p) r)(+ (cadr p) r)) "")
(command "pasteclip" (list (- (car p) r) (- (cadr p) r))) (command "scale""c"(list (- (car p) r) (- (cadr p) r))
(list (+ (car p) r)(+ (cadr p) r)) "" kkk k)
(command "redraw")
(setvar "OSMODE" 4261)
(princ)
)
发表于 2004-8-13 10:00:00 | 显示全部楼层
那个多的圆要先删去然后再拷到剪切板嘛.



本站也有一个象这个功能的程序, 蛮完善的. 是小金鱼写的那个. 你找找看看
 楼主| 发表于 2004-8-13 17:08:00 | 显示全部楼层
谢~~版主,再请教一下,我有个PHA的图层,那么能将放大的圆改成这个图层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-18 21:26 , Processed in 0.186591 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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