meflying 发表于 2004-3-12 21:43:00

适用一些简单图元。。。不适用椭圆及复杂图元。。。


(defun c:test( / ent ents i item item2 key m)<BR>       (setq ent (nentsel))       <BR>       (setq m (caddr ent))<BR>       (setq ents (entget (car ent)))<BR>       (setq i 0)<BR>       (repeat (length ents)<BR>                       (setq item (nth i ents))<BR>                       (setq key (car item))<BR>                       (if (or (= key 10) (= key 11))<BR>                                       (progn<BR>        (setq item2 (chgcs (cdr item) m))<BR>        (setq ents (subst (cons key item2) item ents))<BR>                                       )<BR>                       )<BR>                       (setq i (1+ i))<BR>       )<BR>       (entmake ents)<BR>)

cag 发表于 2004-3-13 18:03:00

太感谢版主了,其他图元我自已试试,多谢!

meflying 发表于 2004-3-13 18:31:00

这个程序只是拓宽一下你的思路,在极特殊的情况下会出错,如某一点转换后的坐标同下一点未转换的坐标相同,就会出错了。。。等等,一个完善的程序要考虑的问题是很多很多的,即使是一个简单的程序

cag 发表于 2004-3-14 18:26:00

以前也发过一个类是的


<A href="http://bbs.mjtd.com/forum.php?mod=viewthread&tid=8073" target="_blank" >http://bbs.mjtd.com/forum.php?mod=viewthread&tid=8073</A>

LIULISHENG 发表于 2020-5-20 14:46:06

学到了学到了
页: 1 [2]
查看完整版本: [求助]获取线两端点的问题