多段线问题
一条多段线,欲在距端点A长度处,画与该线正交的line ,如何做?here...
Use the following visual lisp function can to that...(vlax-curve-getparamatdist)-> to get the param at dist A
(vlax-curve-getpointatdist) -> to get the point
(vlax-curve-getfirstderiv) -> to get the first derivative at that point
The rest is easy.
程序....
(defun C:VV (/ HOLDORTH HOLDANG ENAME VL-OBJ X P PX1 JANG) ;HOLDOSMODE)(vl-load-com)
;;(setq HOLDOSMODE (getvar "osmode"))
(setq HOLDORTH (getvar "orthomode"))
(setq HOLDANG (/ (* (getvar "snapang") 180) pi))
(setq ENAME(car (entsel "\nSelect a valid curve: "))
VL-OBJ (vlax-ename->vla-object ENAME)
)
(setq X (vlax-curve-getparamatpoint
VL-OBJ
(setq P (vlax-curve-getclosestpointto
VL-OBJ
(vlax-curve-getpointatparam
VL-OBJ
(vlax-curve-getparamatdist
VL-OBJ
(getdist (vlax-curve-getstartpoint VL-OBJ)
"\n距端點長度: "
)
)
)
)
)
)
)
;|
(setvar "osmode" 512)
(setq X (vlax-curve-getparamatpoint
VL-OBJ
(setq P (vlax-curve-getclosestpointto
VL-OBJ
(getpoint "\nSelect point on curve: ")
)
)
)
)|;
(setq PX1 (vlax-curve-getfirstderiv VL-OBJ X))
(setq JANG (angle '(0 0 0) PX1))
(command "_.snapang" (/ (* JANG 180) pi))
(prompt "\nInput endpoint of line: ")
(setvar "orthomode" 1)
(command "_.line" P PAUSE "")
(setvar "orthomode" HOLDORTH)
(setvar "snapang" HOLDANG)
;;(setvar "osmode" HOLDOSMODE)
(princ)
)
谢谢 Alin
谢谢龙龙仔,非常好
已经收录。我想这会对搞道桥的有用吧。
可以请教一个问题么?
用(vlax-curve-getparamatpoint curve-obj point) 返回的参数于于该point点是什么关系(vlax-curve-getfirstderiv curve-obj param)返回的曲线在指定位置的第一个衍生于指定点又是什么关系
页:
[1]