这是一个求两条线中线程序,我加载了,但不能用,高手帮着看看,有什么问题。
<FONT face=宋体 size=2>这是一个求两条线中线程序,我加载了,但不能用,高手帮着看看,有什么问题。</FONT><FONT face=宋体 size=2>(defun c:dline_midx (/ e1 e2 p1_s p2_s p1_mid p2_mid)<BR> (if (and<BR>(setq e1 (car (xdrx_entsel "\n请点取第一根LINE<退出>:" '((0 . "line")))))<BR>(progn<BR> (redraw e1 3)<BR> t<BR>)<BR>(setq e2 (car (xdrx_entsel "\n请点取平行的第二根LINE<退出>:" '<BR> ((0 . "line"))<BR> )<BR>)<BR>)<BR> )<BR> (progn<BR> (xdrx_begin)<BR> (xdrx_ucson)<BR> (redraw e1 4)<BR> (xdrx_setenttodb e1)<BR> (setq lyr (xdrx_getentdxf 8))<BR> (setq p1_s (xdrx_curve_getpoint e1)<BR> p2_s (xdrx_curve_getpoint e2)<BR> )<BR> (setq p2_s (apply<BR> 'xdrx_getnearpt<BR> (cons (car p1_s) p2_s)<BR>)<BR> )<BR> (setq p1_mid (xdrx_midp (car p1_s) (car p2_s))<BR> p2_mid (xdrx_midp (last p1_s) (last p2_s))<BR> )<BR> (xdrx_line1 p1_mid p2_mid)<BR> (xdrx_setenttodb (entlast))<BR> (xdrx_modent 8 lyr)<BR> (xdrx_ucsoff)<BR> (xdrx_end)<BR> )<BR> )<BR> (princ)<BR>)<BR>
</FONT> 摘自“晓东CAD空间” 应该到AUTOLISP开发版块问
页:
[1]