您的位置:网站首页 > CAD新闻

让cad2006以下cad支持框选剪切

时间:2009-05-14 08:31:09 来源:

trim.lsp

最后修改时间: 2008年2月26日0时21分


(defun c:t( / pt1 pt2 pt3 pt4 ss)
(princ "n框选剪切 V1.0 xshrimp 2008.2.25")
(setvar "cmdecho" 0) 
(princ "n当前设置:投影=UCS,边=无")
(princ "选择剪切边...")
(setq ss (ssget))
(command "_.TRIM")
(if ss (command ss))
(if    (wcmatch (getvar "cmdnames") "*TRIM*")  (command "")) 
(while (wcmatch (getvar "cmdnames") "*TRIM*"#p#分页标题#e#)
(setvar "cmdecho" 0)
(initget 2 "F P E U") 
(setq pt1 (getpoint "n[栏选(F)/投影(P)/边(E)/放弃(U)]:")) 
    (cond ((= (type pt1) 'STR)            
     (setvar "cmdecho" 1)
     (command pt1)
     (while (wcmatch (getvar "cmdnames") "*TRIM*")  (command pause))  
    )
   ((= (type pt1) 'list)     
     (if   (setq pt2 (getcorner pt1#p#分页标题#e# ))   
    (progn
    (setq pt3 (list (car pt1) (cadr pt2) 0.0)
                        pt4 (list (car pt2) (cadr pt1) 0.0)
                  )
                  (command "F" pt1 pt2 pt3 pt4 "" )
    )
    (command "")        
     ) 
   ) 
   (T (command ""))          
    )
) 
)


以上缺点就是不支持以单个块内线的边界为修剪边界.
处理方法利用R14中类似btrim命令.