cai780506 发表于 2005-11-18 14:10:00

请教斜切图问题?

大量图幅要切割,但只用CAD剪切命令显然工作量太大。extrim后还得用用别的命令,一直想编一个能通过画斜矩形框,从而把框外的图形剪切干净。望高手赐教

小雨点儿 发表于 2005-11-18 19:54:00

<P>试试这个:</P>
<P><A href="http://www.mjtd.com/bbs/Archive_view.asp?boardID=3&amp;ID=25388" target="_blank" >http://www.mjtd.com/bbs/Archive_view.asp?boardID=3&amp;ID=25388</A></P>

cai780506 发表于 2005-11-21 08:17:00

谢谢!

cai780506 发表于 2005-11-21 08:35:00

<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>

cai780506 发表于 2005-11-21 08:39:00

<P>我有一个切正矩形的程请高手帮我改一下,改成选一任意矩形切图程序</P>
<P>(defun c:wSave(/ pzx pys p1 p2 p3 p4 s s1)<BR>&nbsp; (setq pzx (getpoint "\n选择左下角点(用鼠标直接点取或在命令行输入&lt;x,y&gt;):"))<BR>&nbsp; (setq pys (getpoint "\n选择右上角点(用鼠标直接点取或在命令行输入&lt;x,y&gt;):"))<BR>&nbsp; (setq p1 (list (- (car pzx) 0.01) (- (cadr pzx) 0.01)))<BR>&nbsp; (setq p2 (list (+ (car pys) 0.01) (- (cadr pzx) 0.01)))<BR>&nbsp; (setq p3 (list (+ (car pys) 0.01) (+ (cadr pys) 0.01)))<BR>&nbsp; (setq p4 (list (- (car pzx) 0.01) (+ (cadr pys) 0.01)))<BR>&nbsp; (command "rectang" pzx pys)<BR>&nbsp; (setq s (ssget "L"))<BR>&nbsp; (command "trim" s "" "F" p1 p2 "" "F" p2 p3 "" "F" p3 p4 "" "F" p4 p1 "" "")<BR>&nbsp; (command "erase" s "")<BR>&nbsp; (setq s1 (ssget "WP" (list p1 p2 p3 p4 p1)))<BR>&nbsp; (rder s1)<BR>&nbsp; (setq s nil s1 nil)<BR>&nbsp; (setvar "FILEDIA" 0)<BR>&nbsp; (command "SaveAs" "" "d:\\test" "close" "n")<BR>&nbsp; (setvar "FILEDIA" 1)<BR>&nbsp; (princ)<BR>);end wSave<BR>&nbsp; (defun rder(s1 / s2 ent s3 n)<BR>&nbsp;&nbsp;&nbsp;&nbsp; (setq s2 (ssget "X"))<BR>&nbsp;&nbsp;&nbsp;&nbsp; (if (not s1) (command "erase" s2 "")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (progn<BR>&nbsp; (setq s3 (ssadd) n 0)<BR>&nbsp; (repeat (sslength s2)<BR>&nbsp;&nbsp;(setq ent (ssname s2 n))<BR>&nbsp;&nbsp;(if (not (ssmemb ent s1))<BR>&nbsp;&nbsp;&nbsp; (ssadd ent s3)<BR>&nbsp;&nbsp;)<BR>&nbsp;&nbsp;&nbsp; (setq n (1+ n))<BR>&nbsp; )&nbsp; <BR>&nbsp;&nbsp;&nbsp; (command "erase" s3 "" "redraw")<BR>&nbsp; )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp; );end rder</P>
<P><BR>&nbsp;</P>
页: [1]
查看完整版本: 请教斜切图问题?