明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1457|回复: 5

[求助]有没有如下更能的程序!

[复制链接]
发表于 2009-5-20 15:41:00 | 显示全部楼层 |阅读模式

选择矩形框后,实现如下图的功能!

本帖子中包含更多资源

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

x
发表于 2009-5-20 20:29:00 | 显示全部楼层
请问楼主是想要这样的程序还是手头已经有的这样的程序在炫耀?
发表于 2009-5-20 21:04:00 | 显示全部楼层
用WIPEOUT就行了
发表于 2009-5-20 23:17:00 | 显示全部楼层
WIPEOUT只是图形消隐,功能不实用。处理后,一移动图形就原形毕露啦
发表于 2009-5-21 01:01:00 | 显示全部楼层
;;*************************矩形内全部剪切
(defun c:123(/ rect e0 e1 pt x ptx pty l1 i p1 p2 p1x p1y point count)
(setvar "osmode" 0)
(setq l1 nil)
(setq i 0)
(setq rect (car (entsel "\n请选择需剪切的矩形:")))
(setq e0 (entget rect))
(while (setq x (nth i e0))
(if (= (car x) 10)
(progn
(setq ptx (nth 1 x))
(setq pty (nth 2 x))
(setq x (list ptx pty))
(setq l1 (cons x l1))
)
)
(setq i (1+ i))
)
(reverse l1)
(setq p1 (car l1))
(setq p1x (nth 0 p1))
(setq p1y (nth 1 p1))
(setq count 0)
(repeat 3
(setq count (+ count 1))
(setq pt (nth count l1))
(setq ptx (nth 0 pt))
(setq pty (nth 1 pt))
(setq point (mapcar '+ p1 pt))
(setq point (mapcar '/ point '(2.0 2.0 2.0)))
(if
(and (/= (nth 0 point) p1x)
(/= (nth 0 point) ptx)
(/= (nth 1 point) p1y)
(/= (nth 1 point) pty)
)
(setq p point)
)
)
(setq l1 nil)
(command "offset" 5 rect p "")
(setq e0 (entlast))
(setq e1 (entget e0))
(princ e1)
(setq i 0)
(while (setq x (nth i e1))
(if (= (car x) 10)
(progn
(setq ptx (nth 1 x))
(setq pty (nth 2 x))
(setq x (list ptx pty))
(setq l1 (cons x l1))
)
)
(setq i (1+ i))
)
(reverse l1)
(setq p1 (car l1))
(setq p2 p1)
(command "erase" e0 "")
(setq count 0)
(repeat 3
(setq count (+ count 1))
(setq pt (nth count l1))
(command "trim" rect "" "f" p1 pt "" "")
(setq p1 pt)
)
(command "trim" rect "" "f" p1 p2 "" "")
(setvar "osmode" 687)
)
发表于 2009-5-21 10:21:00 | 显示全部楼层

有这个功能的插件太多了,ET中有,贼人工具箱有,晓东工具箱也有

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

本版积分规则

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

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

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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