[原创]房屋直角化
有些不完善,请各为指正。
献丑了 关键是算法模型 (defun c:fw( / xylist s_snapang s_cmdecho mpan makel xy1 xy2 xy pa xyp code ftype en)<BR> (if (not (ishuasystem))<BR> (exit)<BR> )<BR> (setq code (getsysvalue sys_code) ftype (getsysvalue sys_ftype))<BR> (if (/= ftype "2")<BR> (progn<BR> (alert "当前代码非线要素")<BR> (exit)<BR> )<BR> )<BR> ;(setcodecontrol "31313" 2)<BR> (setq hua_pan_word "ON")<BR> (hua_get) <BR> (setvar "cursorsize" 100)<BR> (if (/= (setq s_orthomode (getvar "orthomode")) 0) <BR> (setvar "orthomode" 0)<BR> )<BR> (if (/= (setq s_cmdecho (getvar "cmdecho")) 0)<BR> (setvar "cmdecho" 1)<BR> )<BR> (setq s_snapang (getvar "snapang"))<BR> (princ "\n 请点取起点:")<BR> (setq xylist nil<BR> xy1 (getpoint)<BR> )<BR> (while xy1<BR> (if xy1<BR> (setq xy2 (getpoint xy1 "下一点:"))<BR> )<BR> (if (and xy1 xy2)<BR> (setq xylist (cons xy1 xylist)<BR> xylist (cons xy2 xylist)<BR> pa (angle xy1 xy2)<BR> )<BR> )<BR> (if pa<BR> (setvar "snapang" pa)<BR> )<BR> (setvar "orthomode" 1)<BR> (if (and xy1 xy2)<BR> (grdraw xy1 xy2 -1 1)<BR> )<BR> (setq xy xy2)<BR> (if (and xy1 xy2 (= (length xylist) 2))<BR> (progn<BR> (while xy<BR> (setq xy (getpoint "\n 下一点:"))<BR> (if xy<BR> (progn<BR> (print xylist)<BR> (if(hua_pan xy)<BR> (myGrDraw xylist)<BR> )<BR> (print xylist)<BR> (setq xyP (inters (nth 1 xylist) (nth 0 xylist) xy <BR> (polar xy (+ (angle (nth 1 xylist) (nth 0 xylist)) (/ pi 2)) 100 ) nil)<BR> xylist (subst xyP (nth 0 xylist) xylist)<BR> xylist (cons xy xylist)<BR> )<BR> (grdraw xyP xy -1 1)<BR> ) <BR> )<BR> );while <BR> (if (>= (length xylist) 4) <BR> (setq xyP (inters (nth 1 xylist) (nth 0 xylist)<BR> (nth (1- (length xylist)) xylist) (nth (- (length xylist) 2) xylist) nil)<BR> xylist (cdr xylist)<BR> xylist (subst xyP (nth (1- (length xylist)) xylist) xylist)<BR> xylist (cons (nth (1- (length xylist)) xylist) xylist)<BR> )<BR> )<BR> ;<BR> )<BR> ) <BR> (setq en (makepline xylist))<BR> (if (and en (attachObjData en) (modifyCode en (getsysvalue sys_code)))<BR> (print "成功赋予属性.")<BR> )<BR> (setvar "cmdecho" 0)<BR> (command "_.redraw")<BR> (hua_set)<BR> (setvar "cursorsize" 100)<BR> (princ "\ n 请点取起点:")<BR> (setq xylist nil<BR> xy1 nil<BR> xy1 (getpoint)<BR> )<BR> )<BR> ;(setcodecontrol code (atoi ftype))<BR> (hua_set)<BR>) 请问HOTHUA大虾ishuasystem咋没有呢,他是什么
还有<A name=44931><FONT color=#000066><B>rark123</B></FONT></A>你的命令MM要我选FRIST POINT TO POINT 是做什么的还请详细说明一下你程序的用法吧
谢谢两位好心人 能说明你程序是干什么用的吗?我们也好学习学习呀!!!! 试用一下下 下载学习,感谢楼主分享
页:
[1]