- UID
- 4198
- 积分
- 621
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-4-22
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
[求助]:[0211]如何依据选取的图元图层,作为修剪的依据呢?
小弟想用以下程序完成,
依据选取的图层作为参考依据,
在将其选取的物件作修剪动作.
附张图说明一下.
目前的程序还无法顺利执行
烦请各位高手可以解答一下
谢谢~
[PHP]
(defun c:trimall ()
(vl-load-com)
(setq oldosm (getvar "osmode"))
(setq oldpic (getvar "pickbox"))
(setvar "osmode" 0)
(setvar "pickbox" 5)
(setvar "cmdecho" 0)
(setq flt '((-4 . "<AND")(0 . "LWPOLYLINE")(8 . "trimall")(90 . 4)(-4 . "AND>")));setq
(princ "\nSelect all object to trim: ")
(if (setq ss (ssget flt))
(progn
(command "layer" "lock" "trimall" "")
(setq n 0)
(repeat (sslength ss)
(setq ename (ssname ss n))
(setq vlaob (vlax-ename->vla-object ename))
(setq vlalist (vlax-get-property vlaob 'Coordinates))
(setq vlalist (vlax-variant-value vlalist))
(setq vlalist (vlax-safearray->list vlalist))
(setq p1 (list (nth 0 vlalist) (nth 1 vlalist)))
(setq p2 (list (nth 2 vlalist) (nth 3 vlalist)))
(setq p3 (list (nth 4 vlalist) (nth 5 vlalist)))
(setq p4 (list (nth 6 vlalist) (nth 7 vlalist)))
(setq p13 (polar p1 (angle p1 p3) 0.1))
(setq p31 (polar p3 (angle p3 p1) 0.1))
(setq p24 (polar p2 (angle p2 p4) 0.1))
(setq p42 (polar p4 (angle p4 p2) 0.1))
(command "trim" ename "" "f" p13 p24 p31 p42 "" "")
(setq n (1+ n))
);repeat
(command "layer" "unlock" "trimall" "")
(setvar "osmode" oldosm)
(setvar "pickbox" oldpic)
)
)
(princ)
);defun
[/PHP] |
|