@gaics侠,感谢你的指点,可是本人比较笨拙,麻烦在我上传的源程序上帮改下
看不懂:lol ;画多段线垂线
(defun c:CCX(/ e p d)
(setq ss (ssadd))
(setq d 10);定义垂线长度
(setq e(car(entsel "\n拾取基准线")))
(while(setq p(getpoint "\n垂足位置"))
(setq zz (getreal "\n输入高程:"))
(entmakex ( list'(0 . "LINE")
(cons 10(setq p(vlax-curve-getclosestpointto e p)))
(cons 11(polar p(+(angle p(mapcar'+(vlax-curve-getfirstDeriv e(vlax-curve-getParamAtPoint e p))p))(* pi 0.5))d))))
(ssadd (entlast) ss)
)
(command "_pedit" "M" ss """y""w""0""j""""")
(princ)
) 高手谦虚啦,我感觉不知道从哪里下手,就想能把输入的高程ZZ赋给生成的垂线,看看怎么改? 本帖最后由 gaics 于 2023-6-7 14:56 编辑
wanhongron 发表于 2023-6-6 20:53
高手谦虚啦,我感觉不知道从哪里下手,就想能把输入的高程ZZ赋给生成的垂线,看看怎么改?
(defun c:CCX (/ e p d zz p1)
(setq ss (ssadd))
(setq d 10)
(setq e (car (entsel "\n拾取基准线")))
(while (setq p (getpoint "\n垂足位置"))
(setq zz (getreal "\n输入高程:"))
(setq p (vlax-curve-getclosestpointto e p))
(setq p1
(polar p
(+ (angle p
(mapcar '+
(vlax-curve-getfirstDeriv
e
(vlax-curve-getParamAtPoint e p)
)
p
)
)
(* pi 0.5)
)
d
)
)
(entmakex
(list
'(0 . "LINE")
(cons 10 (list (car p) (cadr p) zz))
(cons 11 (list (car p1) (cadr p1) zz))
)
)
)
(princ)
)新生成的线段貌似无法合并,暂时移除pedit命令。
@gaics大侠,果然深藏不露,正式我需要的效果,非常感谢大侠的热心帮助
页:
1
[2]