曲线上放样
(defun C:ff ( / &dis1 &dis2 &k1 &n1&p1 p2 &ss1 &len yx)(if (null vlax-dump-object) (vl-load-com) )
(setq &ss1 '("LINE" "LWPOLYLINE" "CIRCLE" "ARC" "HELIX" "ELLIPSE" "SPLINE" "POLYLINE")) ;曲线有起点:直线,多段线,圆,圆弧,螺旋对象,椭圆,样条曲线,二维多段线
(setq &k1 (entsel "\n请选择曲线"))
(while (= nil &k1)
(setq &k1 (entsel "\n没有选择曲线,重新选择"))
)
(setq &k1 (car &k1))
(member (cdr (assoc 0 (entget &k1))) &ss1);确认是曲线
(setq &p1 (getpoint "\n选择曲线上第一点:"))
(while (not (vlax-curve-getDistAtPoint &k1 &p1))
(setq &p1 (getpoint "\n没有选在曲线上,重新选择:"))
)
(setq &len (getreal "\n输入偏移长度:"))
(setq &p1 (vlax-curve-getclosestpointto &k1 &p1));取得最近点
(setq &n1 (vlax-curve-getParamAtPoint &k1 &p1));取得参数
(setq &dis1 (vlax-curve-getDistAtParam &k1 &n1));到起点距离
(setq &dis2 (+ &dis1 &len))
(setq p2 (vlax-curve-getPointAtDist &k1 &dis2))
(setq yx (getpoint p2))
;(princ (strcat "\n p2的坐标是" &p2))
(command "circle" yx "1");命令行显示
(princ)
)
请问这段代码为什么一直画不出最后的圆那? 还有如果选择的曲线是圆弧也有问题,该怎么调试那?
一行一行试
页:
[1]