请教斜切图问题?
大量图幅要切割,但只用CAD剪切命令显然工作量太大。extrim后还得用用别的命令,一直想编一个能通过画斜矩形框,从而把框外的图形剪切干净。望高手赐教 <P>试试这个:</P><P><A href="http://www.mjtd.com/bbs/Archive_view.asp?boardID=3&ID=25388" target="_blank" >http://www.mjtd.com/bbs/Archive_view.asp?boardID=3&ID=25388</A></P> 谢谢! <TABLE class=tablebody2 style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all" width="90%" border=0>
<TBODY>
<TR>
<TD style="FONT-SIZE: 9pt; LINE-HEIGHT: 12pt" width="100%">高手,这个lisp程序只能切正矩形里面的的图形,我想要一个能通过画斜矩形框,从而把框外的图形剪切干净。望高手赐教</TD></TR></TBODY></TABLE> <P>我有一个切正矩形的程请高手帮我改一下,改成选一任意矩形切图程序</P>
<P>(defun c:wSave(/ pzx pys p1 p2 p3 p4 s s1)<BR> (setq pzx (getpoint "\n选择左下角点(用鼠标直接点取或在命令行输入<x,y>):"))<BR> (setq pys (getpoint "\n选择右上角点(用鼠标直接点取或在命令行输入<x,y>):"))<BR> (setq p1 (list (- (car pzx) 0.01) (- (cadr pzx) 0.01)))<BR> (setq p2 (list (+ (car pys) 0.01) (- (cadr pzx) 0.01)))<BR> (setq p3 (list (+ (car pys) 0.01) (+ (cadr pys) 0.01)))<BR> (setq p4 (list (- (car pzx) 0.01) (+ (cadr pys) 0.01)))<BR> (command "rectang" pzx pys)<BR> (setq s (ssget "L"))<BR> (command "trim" s "" "F" p1 p2 "" "F" p2 p3 "" "F" p3 p4 "" "F" p4 p1 "" "")<BR> (command "erase" s "")<BR> (setq s1 (ssget "WP" (list p1 p2 p3 p4 p1)))<BR> (rder s1)<BR> (setq s nil s1 nil)<BR> (setvar "FILEDIA" 0)<BR> (command "SaveAs" "" "d:\\test" "close" "n")<BR> (setvar "FILEDIA" 1)<BR> (princ)<BR>);end wSave<BR> (defun rder(s1 / s2 ent s3 n)<BR> (setq s2 (ssget "X"))<BR> (if (not s1) (command "erase" s2 "")<BR> (progn<BR> (setq s3 (ssadd) n 0)<BR> (repeat (sslength s2)<BR> (setq ent (ssname s2 n))<BR> (if (not (ssmemb ent s1))<BR> (ssadd ent s3)<BR> )<BR> (setq n (1+ n))<BR> ) <BR> (command "erase" s3 "" "redraw")<BR> )<BR> )<BR> );end rder</P>
<P><BR> </P>
页:
[1]