明经CAD社区

 找回密码
 注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 2473|回复: 6

[原创]房屋直角化

[复制链接]
发表于 2004-8-24 09:45 | 显示全部楼层 |阅读模式



有些不完善,请各为指正。


献丑了

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2004-10-11 20:24 | 显示全部楼层
关键是算法模型
发表于 2004-10-31 10:47 | 显示全部楼层
(defun c:fw( / xylist s_snapang s_cmdecho mpan makel xy1 xy2 xy pa xyp code ftype en)
(if (not (ishuasystem))
(exit)
)
(setq code (getsysvalue sys_code) ftype (getsysvalue sys_ftype))
(if (/= ftype "2")
(progn
(alert "当前代码非线要素")
(exit)
)
)
;(setcodecontrol "31313" 2)
(setq hua_pan_word "ON")
(hua_get)
(setvar "cursorsize" 100)
(if (/= (setq s_orthomode (getvar "orthomode")) 0)
(setvar "orthomode" 0)
)
(if (/= (setq s_cmdecho (getvar "cmdecho")) 0)
(setvar "cmdecho" 1)
)
(setq s_snapang (getvar "snapang"))
(princ "\n 请点取起点:")
(setq xylist nil
xy1 (getpoint)
)
(while xy1
(if xy1
(setq xy2 (getpoint xy1 "下一点:"))
)
(if (and xy1 xy2)
(setq xylist (cons xy1 xylist)
xylist (cons xy2 xylist)
pa (angle xy1 xy2)
)
)
(if pa
(setvar "snapang" pa)
)
(setvar "orthomode" 1)
(if (and xy1 xy2)
(grdraw xy1 xy2 -1 1)
)
(setq xy xy2)
(if (and xy1 xy2 (= (length xylist) 2))
(progn
(while xy
(setq xy (getpoint "\n 下一点:"))
(if xy
(progn
(print xylist)
(if(hua_pan xy)
(myGrDraw xylist)
)
(print xylist)
(setq xyP (inters (nth 1 xylist) (nth 0 xylist) xy
(polar xy (+ (angle (nth 1 xylist) (nth 0 xylist)) (/ pi 2)) 100 ) nil)
xylist (subst xyP (nth 0 xylist) xylist)
xylist (cons xy xylist)
)
(grdraw xyP xy -1 1)
)
)
);while
(if (>= (length xylist) 4)
(setq xyP (inters (nth 1 xylist) (nth 0 xylist)
(nth (1- (length xylist)) xylist) (nth (- (length xylist) 2) xylist) nil)
xylist (cdr xylist)
xylist (subst xyP (nth (1- (length xylist)) xylist) xylist)
xylist (cons (nth (1- (length xylist)) xylist) xylist)
)
)
;
)
)
(setq en (makepline xylist))
(if (and en (attachObjData en) (modifyCode en (getsysvalue sys_code)))
(print "成功赋予属性.")
)
(setvar "cmdecho" 0)
(command "_.redraw")
(hua_set)
(setvar "cursorsize" 100)
(princ "\ n 请点取起点:")
(setq xylist nil
xy1 nil
xy1 (getpoint)
)
)
;(setcodecontrol code (atoi ftype))
(hua_set)
)

点评

004
缺少的自定义函数太多,可以看看思路,但无法使用.  发表于 2012-12-3 05:18
发表于 2004-11-16 20:55 | 显示全部楼层
请问HOTHUA大虾ishuasystem咋没有呢,他是什么 还有rark123你的命令MM要我选FRIST POINT TO POINT 是做什么的还请详细说明一下你程序的用法吧 谢谢两位好心人
发表于 2004-12-2 20:50 | 显示全部楼层
能说明你程序是干什么用的吗?我们也好学习学习呀!!!!
发表于 2017-9-11 09:19 | 显示全部楼层
试用一下下
发表于 2017-11-28 17:18 | 显示全部楼层
下载学习,感谢楼主分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号  
©2000-2017 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2018-6-26 01:37 , Processed in 0.254682 second(s), 32 queries , Gzip On.

Powered by Discuz! X3.3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表