增加输入高程功能
网上下载的画多段线垂线程序,挺好用,麻烦大侠帮增加输入高程功能你这问题也太多了吧 本帖最后由 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命令。
;画多段线垂线
(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)
) 楼主上几张生活照,让大侠们提提神才能更好的服务论坛啊 辛苦大家了,我做水利设计的,老被领导叼杠效率低,工作压力大了就什么方法都想 谢谢楼主分享 麻烦指点一下在创建直线的时候怎么添加Z高程值 wanhongron 发表于 2023-6-6 15:38
麻烦指点一下在创建直线的时候怎么添加Z高程值
兄弟,那你明经币搞个悬赏啥都有了:lol (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))))
生成直线只有x、y坐标,怎么增加Z坐标?
(setq p(vlax-curve-getclosestpointto e p))
(cons 10(list (car p) (cadr p) z)) @gaics侠,感谢你的指点,可是本人比较笨拙,麻烦在我上传的源程序上帮改下
页:
[1]
2