本帖最后由 作者 于 2004-1-23 5:33:27 编辑
研究了一下,这样也行?

- (defun x@outline1 ()
- (setvar "qaflags" 1)
- (setq ss0 (ssget "all")
- ss (ssget))
- (vl-cmdf "_.copy" ss "" "0,0" "@")
- (vl-cmdf "_.region" "all" "r" ss0 ""
- "_.union" "all" "r" ss0 ""
- "_.explode" "all" "r" ss0 ""
- "_.explode" "all" "r" ss0 ""
- "_.pedit" "m" "all" "r" ss0 "" "y" "j" "1" ""
- "_.region" "all" "r" ss0 ""
- "_.union" "all" "r" ss0 ""
- "_.explode" "all" "r" ss0 ""
- "_.explode" "all" "r" ss0 ""
- "_.pedit" "m" "all" "r" ss0 "" "y" "j" "1" ""
- )
- )
- (defun x@outline2 ()
- (vl-cmdf ".undo" "be")
- (setq os (getvar "osmode"))
- (setvar "osmode" 0)
- (setvar "qaflags" 1)
- (setq ss0 (ssget "all")
- ss (ssget '((0 . "*POLYLINE,LINE,ARC,CIRCLE,ELLIPSE")))
- vmin (getvar "VSMIN")
- vmax (getvar "VSMAX")
- dist (* 2 (getvar "VIEWSIZE") (/ (getvar "PICKBOX") 100)))
- (vl-cmdf ".RECTANGLE" (polar vmin (* 1.25 PI) dist) (polar vmax (* 0.25 PI) dist))
- (setq em (entlast))
- (vl-cmdf "_.boundary" "a" "o" "P" "i" "y" "b" "n" ss em "" "" emin "")
- (setvar "osmode" os)
- (vl-cmdf ".undo" "e")
- )
测试了一下,用region只能对封闭实体有效,可惜,可惜。用boundary可以对line,arc等封闭的区域有效,但通用性又没region好。我觉得两者应该结合起来。 |