用grread总是不便,完善了一下hao3ren老师的程序,请楼主试用.......- (defun c:jd(/ oldosmode pt1 pt2 tg pt3 entlst)
- (command "undo" "be")
- (setvar 'cmdecho 0)
- (setq oldosmode (getvar 'osmode))
- (setq pt1 (getpoint "/n指定第1点:"))
- (setq pt2 (getpoint pt1 "/n指定第2点:"))
- (command "line" pt1 pt2 "")
- (setq tg (entLast))
- (setvar 'osmode 0)
- (setq pt3 (getpoint "/n指定剪切边:"))
- (foreach x (mapcar 'cadr (cdr(reverse(ssnamex
- (ssget "cp" (list pt1 pt2 pt3))))))
- (setq entlst (append entlst(list(list x pt3) )))
- )
- (foreach x entlst
- (command "trim" tg "" x "")
- )
- (entdel tg)
- (setvar 'osmode oldosmode)
- (command "undo" "e")
- (princ)
- )
|